我们经常IQ卸载,再装入IQ,可以采用二进制方式卸载和装载,就完全避免了分隔符和空值等问题。
先采用二进制方式导出数据,方法如下:
SET TEMPORARY OPTION temp_extract_directory='/load_data/';
SET TEMPORARY OPTION temp_extract_name1='test.bin';
SET TEMPORARY OPTION Temp_Extract_Append = 'OFF';
SET TEMPORARY OPTION Temp_Extract_Binary =ON;
SELECT * FROM AA;
其中directory是指iq数据库所在服务器的目录,存储的文件名是test.bin
下面再把这个文件中的内容导入到表AAA中,方法如下:
LOAD INTO TABLE "DBA"."AAA" (
"VENDOR_SID" BINARY WITH NULL BYTE ,
"STKPVD_DIM_ID" BINARY WITH NULL BYTE ,
"PVD_CD" BINARY WITH NULL BYTE ,
"STK_ID" BINARY WITH NULL BYTE ,
"STK_NM" BINARY WITH NULL BYTE ,
"STK_ID1" BINARY WITH NULL BYTE ,
"STK_NM1" BINARY WITH NULL BYTE ,
"STK_ID2" BINARY WITH NULL BYTE ,
"STK_NM2" BINARY WITH NULL BYTE ,
"STK_ID3" BINARY WITH NULL BYTE ,
"STK_NM3" BINARY WITH NULL BYTE ,
"PVD_ID" BINARY WITH NULL BYTE ,
"PVD_NM" BINARY WITH NULL BYTE ,
"PVD_SHORT" BINARY WITH NULL BYTE ,
"ADDRESS" BINARY WITH NULL BYTE ,
"BANK" BINARY WITH NULL BYTE ,
"PVD_KIND" BINARY WITH NULL BYTE ,
"REGFUND" BINARY WITH NULL BYTE ,
"PVD_CLS" BINARY WITH NULL BYTE ,
"TAX_CLS" BINARY WITH NULL BYTE ,
"STFROM" BINARY WITH NULL BYTE ,
"PAY_MODE" BINARY WITH NULL BYTE ,
"STCYC" BINARY WITH NULL BYTE ,
"STMODE" BINARY WITH NULL BYTE ,
"INDATE" BINARY WITH NULL BYTE ,
"STATUS" BINARY WITH NULL BYTE ,
"SHZQ" BINARY WITH NULL BYTE ,
"EFT_START_DT" BINARY WITH NULL BYTE ,
"EFT_END_DT" BINARY WITH NULL BYTE ,
"CREATED_DT" BINARY WITH NULL BYTE ,
"CHANGED_DT" BINARY WITH NULL BYTE ,
"CURRENT_IND" BINARY WITH NULL BYTE
)
FROM '/load_data/test.bin'
QUOTES OFF
ESCAPES OFF
FORMAT binary;
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11289496/viewspace-972646/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11289496/viewspace-972646/