
If you were logged in you would be able to see more operations.
|
|
|
Issue Links:
|
Duplicate
|
This issue duplicates:
|
|
CORE-2005
Support SQL 2008 syntax for MERGE statement with DELETE extension
|
|
|
|
|
|
|
|
now merge operation look like
MERGE
INTO customers c
USING (SELECT * FROM customers_delta WHERE id > 10) cd
ON (c.id = cd.id)
WHEN MATCHED THEN
UPDATE SET
name = cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (cd.id, 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 (c.id = cd.id)
WHEN MATCHED THEN
IF (name<>cd.name) THEN /* here is modification in merge statement */
UPDATE SET
name = cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (cd.id, cd.name)
This modification reduced the number of versions of record
because we only update record when the condition is met
|
Description
|
now merge operation look like
MERGE
INTO customers c
USING (SELECT * FROM customers_delta WHERE id > 10) cd
ON (c.id = cd.id)
WHEN MATCHED THEN
UPDATE SET
name = cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (cd.id, 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 (c.id = cd.id)
WHEN MATCHED THEN
IF (name<>cd.name) THEN /* here is modification in merge statement */
UPDATE SET
name = cd.name
WHEN NOT MATCHED THEN
INSERT (id, name)
VALUES (cd.id, cd.name)
This modification reduced the number of versions of record
because we only update record when the condition is met |
Show » |
|
WHEN MATCHED AND (NAME <> CD.NAME) THEN UPDATE ...