You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now merge operation look like
MERGE
INTO customers c
USING (SELECT * FROM customers_delta WHERE id > 10) cd
ON (http://c.id = http://cd.id)
WHEN MATCHED THEN
UPDATE SET
name = http://cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (http://cd.id, http://cd.name)
will be good if we can check field values before update/or not update
example
MERGE
INTO customers c
USING (SELECT * FROM customers_delta WHERE id > 10) cd
ON (http://c.id = http://cd.id)
WHEN MATCHED THEN
IF (name<>http://cd.name) THEN /* here is modification in merge statement */
UPDATE SET
name = http://cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (http://cd.id, http://cd.name)
This modification reduced the number of versions of record
because we only update record when the condition is met
The text was updated successfully, but these errors were encountered:
Submitted by: @livius2
Duplicates CORE2005
now merge operation look like
MERGE
INTO customers c
USING (SELECT * FROM customers_delta WHERE id > 10) cd
ON (http://c.id = http://cd.id)
WHEN MATCHED THEN
UPDATE SET
name = http://cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (http://cd.id, http://cd.name)
will be good if we can check field values before update/or not update
example
MERGE
INTO customers c
USING (SELECT * FROM customers_delta WHERE id > 10) cd
ON (http://c.id = http://cd.id)
WHEN MATCHED THEN
IF (name<>http://cd.name) THEN /* here is modification in merge statement */
UPDATE SET
name = http://cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (http://cd.id, http://cd.name)
This modification reduced the number of versions of record
because we only update record when the condition is met
The text was updated successfully, but these errors were encountered: