将表从mssql server加载到informix db时出错

pokxtpni  于 2021-07-29  发布在  Java
关注(0)|答案(1)|浏览(515)

我正在尝试从mssql-IBMInformixDB加载一个表。没有主键的表将被加载,但是有主键的表不会加载并引发以下错误

Stream component 'st_2_Informix_Target' terminated
Stream component failed at subtask 2, component st_2_Informix_Target
Error executing data handler
Handling new table 'dbo'.'region3' failed
execute create primary key failed, statement ALTER TABLE dbo.region3 ADD CONSTRAINT region3_PK__region3__3213E83F82CE48A3 PRIMARY KEY ( id )
RetCode: SQL_ERROR  SqlState: 42000 NativeError: -201 Message: [Informix][Informix ODBC Driver][Informix]A syntax error has occurred.
Failed (retcode -1) to execute statement: 'ALTER TABLE dbo.region3 ADD CONSTRAINT region3_PK__region3__3213E83F82CE48A3 PRIMARY KEY ( id )'
yqlxgs2m

yqlxgs2m1#

有人(我猜是sqlserver或dms)试图使用sqlserversql语法向informix表添加主键,这在informix中是无效的。

> ALTER TABLE dbo.region3 ADD CONSTRAINT region3_PK__region3__3213E83F82CE48A3 PRIMARY KEY ( id );

  201: A syntax error has occurred.
Error in line 1
Near character position 40

> ALTER TABLE dbo.region3 ADD CONSTRAINT  PRIMARY KEY ( id ) CONSTRAINT region3_PK__region3__3213E83F82CE48A3;

Table altered.

>

我建议在执行加载任务时检查是否有任何选项可以禁用pk创建。

相关问题