by maslopo » Fri Jan 18, 2013 9:19 am
I often use the construct sql MERGE I never found the generation of this construct that performs the update / insert / delete, I'd like dbever was one of the few to implement
an example for Database : VERTICA,ORACLE,SQLSERVER ...
MERGE INTO target_table AS Target
USING source_table AS Source
ON ( Target.key_field = Source.key_field )
WHEN MATCHED
THEN UPDATE SET
data= target.data , data2=target.data2
WHEN NOT MATCHED
THEN INSERT ( key_field,dat,data2)
VALUES
( target.key_field,target.dat,target.data2 );