“写入文件_exportdb2”,通过参数自动生成db2导出脚本。
脚本如下:
db2 CONNECT TO BI USER "user" USING "password"
db2 "EXPORT TO D:\test\expdir\ODS_2_BI\${qy_table_name}.txt OF DEL lobs to D:\test\expdir\ODS_2_BI\ lobfile ${qy_table_name}_content MODIFIED BY CODEPAGE=1208 chardel${str_chardel} coldel${str_coldel} TIMESTAMPFORMAT=\"yyyy-mm-dd hh:mm:ss\"lobsinfile SELECT ${qy_table_name}.*,'${str_linedel}' FROM ${qy_table_name} where ${str_where_sql}"
db2 terminate