ITPub博客

首页 > 数据库 > 数据库开发技术 > sybase iq中的load语句 3

sybase iq中的load语句 3

原创 数据库开发技术 作者:gavin-wu 时间:2007-09-27 12:35:21 0 删除 编辑

我们经常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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    11
  • 访问量
    20665