db2look導(dǎo)出建表語句 db2怎么把所有表中的數(shù)據(jù)導(dǎo)出成insertinto語句?
db2怎么把所有表中的數(shù)據(jù)導(dǎo)出成insertinto語句?db2的存儲過程也可以執(zhí)行動態(tài)SQL,你可以把"001","002" 檔次一個參數(shù)傳進(jìn)存儲過程,然后聲明一個變量: create or rep
db2怎么把所有表中的數(shù)據(jù)導(dǎo)出成insertinto語句?
db2的存儲過程也可以執(zhí)行動態(tài)SQL,你可以把"001","002" 檔次一個參數(shù)傳進(jìn)存儲過程,然后聲明一個變量:
create or replace procedure test(in in_where varchar(100)) --創(chuàng)建一個存儲過程test,并可以傳入字符串作為參數(shù)declare v_sql varchar(512) set v_sql = " delete from table1 where field1 in (" concat in_where concat ") " -- 這里是把傳進(jìn)來的where語句拼起來execute immediate v_sql --這里是把語句進(jìn)行執(zhí)行--------- 類似以上這樣的存儲過程,使用以下的放在進(jìn)行執(zhí)行即可:call test( " ""001"",""002"" ") --內(nèi)容中的一個‘ 需要使用 ’‘ 進(jìn)行轉(zhuǎn)義
db2使用命令導(dǎo)出指定表的數(shù)據(jù)到一個執(zhí)行insert語句的sql文件中?
DB2可視化界面軟件Aqua Data Studio --> tools --> export data ,然后選擇你要導(dǎo)出的表,就可以把數(shù)據(jù)導(dǎo)出到你的指定文件中。(帶insert語句的)
DB2外部文件如何導(dǎo)入導(dǎo)出(二)求解?
這個格式是由導(dǎo)出語句定義的. 導(dǎo)出 db2 export to [文件名].ixf of ixf select * from [表名] 或者 db2 export to [文件名].del of del select * from [表名] 導(dǎo)入 有兩種方式 import 與load 我只介紹import吧 db2 import from [文件名].ixf of ixf insert into [表名] db2 import from [文件名].del of del insert into [表名] 命令里還有很多選項,自己看教程吧