Best way to do multi-row insert in Oracle?

前端 未结 9 1412
悲&欢浪女
悲&欢浪女 2020-11-22 02:52

I\'m looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn\'t seem to be supported in Oracle.



        
9条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 03:44

    This works in Oracle:

    insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)
              select 8000,0,'Multi 8000',1 from dual
    union all select 8001,0,'Multi 8001',1 from dual
    

    The thing to remember here is to use the from dual statement.

    (source)

提交回复
热议问题