Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Oracle INSERT in zwei Tabellen in einer Abfrage

Versuchen Sie, from dual; zu verwenden , etwa so:

INSERT ALL
INTO table1
  (tid, date, title) values (s_tid, s_date, s_title)
INTO table2
  (tid, date, user, note) values (s_tid, s_date, s_user, s_note)
SELECT s_tid, s_date, s_title, s_user, s_note
FROM
( 
    SELECT 
        1 s_tid,
        '01-JAN-15' s_date,
        'title' s_title,
        'john' s_user,
        'test note' s_note
    FROM dual;
)