在Windows上的db之间传输数据到linux

时间:2017-12-29 10:55:14

标签: linux windows db2

我有这个错误,当我尝试将数据从Windows上的db2 db传输到linux上的db时,由ibm data studio:

CALL SYSPROC.ADMIN_CMD( 'LOAD FROM Path\file.dat OF IXF  REPLACE INTO 
Schema.Table(ID, SID, REFERENCE, UCI, STATE, DEBTORNAME, DEBTORADDR,DEBTORZIP, DEBTORCITY, DEBTORPROVINCE, DEBTORCOUNTRY, DEBTORIBAN,
DEBTORBIC,CREDITORNAME, CREDITORADDR, CREDITORZIP, CREDITORCITY, CREDITORPROVINCE,CREDITORCOUNTRY, CREDITORIBAN, CREDITORBIC, ORGANIZATIONID,
SEQUENCETYPE, ROLE,LASTDATEOFCOLL, LASTTYPEOFCOLL, CURRENTSCHEME, SIGNATURECITY, SIGNATUREDATE, REFDEBTNAME, REFCREDNAME, COMMENTS, SOURCE,
LASTMODIFIEDBY, LASTMODIFIED, LASTSTATE, MAXAMOUNT, REQUESTCOUNT, MAXREQUESTS, VALIDFROM, VALIDTO, MANDATETYPE, HASAMENDMENT, PREVIOUSMANDATEID,
ORIREFERENCE, ORIUCI, ORICREDITORNAME, ORIDEBTORIBAN, ORIDEBTORBIC, EXTERNALID, EXTERNALREFERENCE, CUSTSPEC1, CUSTSPEC2, CUSTSPEC3, CREATIONTIME)'
 )

我有这个错误:

An unexpected token "COMMENTS" was found following ",".  Expected tokens may include:  "<identifier>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.19.5

1 个答案:

答案 0 :(得分:1)

COMMENTS显然是一个保留字(尽管当我查找DB2保留字列表时,它只包含COMMENT,而不是复数形式)。所以你需要把它放在引号中以逃避它。

CALL SYSPROC.ADMIN_CMD( 'LOAD FROM Path\file.dat OF IXF  REPLACE INTO 
Schema.Table(ID, SID, REFERENCE, UCI, STATE, DEBTORNAME, DEBTORADDR,DEBTORZIP, DEBTORCITY, DEBTORPROVINCE, DEBTORCOUNTRY, DEBTORIBAN,
DEBTORBIC,CREDITORNAME, CREDITORADDR, CREDITORZIP, CREDITORCITY, CREDITORPROVINCE,CREDITORCOUNTRY, CREDITORIBAN, CREDITORBIC, ORGANIZATIONID,
SEQUENCETYPE, ROLE,LASTDATEOFCOLL, LASTTYPEOFCOLL, CURRENTSCHEME, SIGNATURECITY, SIGNATUREDATE, REFDEBTNAME, REFCREDNAME, ''COMMENTS'', SOURCE,
LASTMODIFIEDBY, LASTMODIFIED, LASTSTATE, MAXAMOUNT, REQUESTCOUNT, MAXREQUESTS, VALIDFROM, VALIDTO, MANDATETYPE, HASAMENDMENT, PREVIOUSMANDATEID,
ORIREFERENCE, ORIUCI, ORICREDITORNAME, ORIDEBTORIBAN, ORIDEBTORBIC, EXTERNALID, EXTERNALREFERENCE, CUSTSPEC1, CUSTSPEC2, CUSTSPEC3, CREATIONTIME)'
 )