plsql批量insert多條 oracle插入多行數(shù)據(jù)并使用序列?
oracle插入多行數(shù)據(jù)并使用序列?insert into area(area_no , area_name , city_no) SELECT seq_area.nextval, area
oracle插入多行數(shù)據(jù)并使用序列?
insert into area(area_no , area_name , city_no) SELECT seq_area.nextval, area_name,city_no from zongchd直接寫(xiě)成上面這個(gè)樣子
oracle中怎么插入多條數(shù)據(jù)?
1、采用insert into values 語(yǔ)句插入一條,寫(xiě)很多條語(yǔ)句即可多條數(shù)據(jù),這種主要針對(duì)于離散值以及一些基礎(chǔ)信息的錄入,如:insert into test(xh,mc) values("123","測(cè)試")impdp 用戶(hù)名/密碼 dumpfile=123.dmp logfile=123.log directory=imp_dir tables=test table_exists_action=append4、使用excel文件直接拷貝。這種主要用于要寫(xiě)入的數(shù)據(jù)已是excel文件或者行列分明的其它格式文件,每一列的值和表結(jié)構(gòu)相對(duì)應(yīng),可直接打開(kāi)表的行級(jí)鎖,把數(shù)據(jù)拷貝進(jìn)入。
Oracle中使用PL/SQL怎樣用循環(huán)插入多條數(shù)據(jù)?
使用loop循環(huán),比如:
for item in (select a,b,c from table_a where 條件) loop
insert into table_b(a,b,c) values (item.a,item.b,item.c)
end loop
也可以使用索引表循環(huán),以上只是一個(gè)簡(jiǎn)單的例子,需要根據(jù)你的具體情況選擇循環(huán)方式