Skip to content

Instantly share code, notes, and snippets.

@tqheel
Created January 17, 2013 22:31
Show Gist options
  • Save tqheel/4560463 to your computer and use it in GitHub Desktop.
Save tqheel/4560463 to your computer and use it in GitHub Desktop.
Oracle PL/SQL for doing multiple Inserts with a UNION ALL statement, when a sequencer sets the primary key value.
insert into app_item(app_item_id, control_id, app_page_id, description, default_label)
select SEQ_APP_ITEM.nextval, a, b, c, d from
(
select'LabelNameSuffix' as a, 183 as b, 'Name Suffix' as c, 'Name Suffix' as d from dual
union all
select 'LabelFax', 184, 'Fax Number', 'Fax Number' from dual
)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment