This content has been marked as final. Show 3 replies
Yes, you can do that.
You actually have to SELECT the data from some table. The dual table is handy for this:
Just change the literals 1 and 'Foo' in the src query to whatever you want.
MERGE INTO table_x dst USING ( SELECT 1 AS id , 'Foo' AS name FROM dual ) src ON (src.id = dst.id) WHEN MATCHED THEN UPDATE SET dst.name = src.name WHEN NOT MATCHED THEN INSERT (dst.id, dst.name) VALUES (src.id, src.name) ;
Of course, you can have any number and type of columns.