question

BI DWH BALA avatar image
BI DWH BALA asked

Update and Insert in a single statment?

Hi,

I have 2 tables.

Can we update and insert records in Table A based on Table B in a single sql statement?

Thanks in advance BI DWH BALA

oracle
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
BI DWH BALA avatar image
BI DWH BALA answered

There is one statement called MERGE UPDATE. This statement is working fine where it inserts records and update records on Table A based on Table B in a single sql statement.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Leigh Riffel avatar image Leigh Riffel commented ·
Glad you found it. FYI the statement is just MERGE. UPDATE is just one of the things you can do with a MERGE statement.
1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.