一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

Oracle批量插入数据的三种方式

时间:2022-06-29 09:26:38 编辑:袖梨 来源:一聚教程网

第一种:

begin
  insert into tableName(column1, column2, column3...) values(value1,value2,value3...);
  insert into tableName(column1, column2, column3...) values(value1,value2,value3...);
  insert into tableName(column1, column2, column3...) values(value1,value2,value3...);
  ...
end;

第二种:

insert into tableName(column1, column2, column3...) values(value1,value2,value3...);
insert into tableName(column1, column2, column3...) values(value1,value2,value3...);
insert into tableName(column1, column2, column3...) values(value1,value2,value3...);

第三种(利用中间表):

insert into tableName(column1(主键),column2,column3...)
  select tableNames_seq.nextval,,column2,column3... from (
  select value1 column2,value2 column3,value3 column4 from dual
  union
  select value1 column2,value2 column3,value3 column4 from dual
  union
  select value1 column2,value2 column3,value3 column4 from dual
  union
  select value1 column2,value2 column3,value3 column4 from dual
)

热门栏目