UPDATE multiple tables simultaneously in Oracle

UPDATE multiple tables simultaneously in Oracle

How to UPDATE multiple tables simultaneously in Oracle.

INNER JOIN can be used to update items in multiple tables at the same time.

UPDATE
(
  select T1.CODE AS A,
         T2.NAME AS B
  FROM
      TBL1 T1
  INNER JOIN TBL2 T2
   ON T1.COLUMN1 = T2.COLUMN1
 WHERE T1.NAME = 'TEST'
)
SET 
 A = '01',
 B = '02'

It works fine with Oracle but DB2 gave the following error.

[SQL0104] Token ( is incorrect.

コメント

Discover more from 株式会社CONFRAGE ITソリューション事業部

Subscribe now to keep reading and get access to the full archive.

Continue reading

Copied title and URL