Help for this page

Select Code to Download


  1. or download this
    insert into FooBar (ID, col1, col2, col3)
    values ((select max(ID)+1 from FooBar), 'a', 1, 'flort'),
           ((select max(ID)+2 from FooBar), 'b', 2, 'zap'),
           ((select max(ID)+3 from FooBar), 'c', 3, 'kazoo')
    
  2. or download this
    insert into FooBar (ID, col1, col2, col3)
    select ID, col1, col2, col3 from (
    ...
        union
        select max(ID)+1 from FooBar), 'c', 3, 'kazoo'
    )
    
  3. or download this
    declare
       v_ID number;
    ...
       insert into BarBaz (ID, col1)
       values (v_ID+1, 'etcetera');
    end;