oracle multiple insert 1

oracle multiple insert

INSERT INTO real_table_name (person_id, given_name, family_name, title) 
  WITH temp_table AS ( 
    SELECT 4, 'Ruth',     'Fox',      'Mrs'    FROM dual UNION ALL 
    SELECT 5, 'Isabelle', 'Squirrel', 'Miss'   FROM dual UNION ALL 
    SELECT 6, 'Justin',   'Frog',     'Master' FROM dual UNION ALL 
    SELECT 7, 'Lisa',     'Owl',      'Dr'     FROM dual 
  ) 
  SELECT * FROM temp_table

Here is what the above code is Doing:
1. Create a temporary table called temp_table.
2. Insert the data into the temp_table.
3. Insert the data from the temp_table into the real_table_name.

Similar Posts