Updating DB2 server timestamp through Userdefined SQL
Posted: Mon Feb 23, 2009 7:23 am
Hi ,
The requirement is to pass the Current timestamp value to the UPDATE_TIMESTAMP column, but to fetch its value from the DB2 server and not the DS server.So I have modified the update query as follows:
UPDATE #TargetSchemaName#.ARREARS_LETTER_INFORMATION SET LAST_ARREARS_LETTER_TYPE=?,LAST_ARREARS_LETTER_DATE=?,DELETE_FLAG=?,UPDATE_TIMESTAMP =
(select current timestamp from sysibm.sysdummy1) WHERE PART_KEY=? AND COMPANY_CD=? AND CUSTOMER_NBR=? AND BILLING_ITEM_NBR=? AND SEQUENCE_NBR=? AND COUNTRY_CD=?;
But this throws warnings as follows :
DSTAGE-DB2CLI-0103`:`Row rejected.
DBMS.CODE=-99999, SQLSTATE=22001, [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=2200
Also am unable to view data through this DB2 API stage.
Please give me your suggestions.
Regards,
Priya
The requirement is to pass the Current timestamp value to the UPDATE_TIMESTAMP column, but to fetch its value from the DB2 server and not the DS server.So I have modified the update query as follows:
UPDATE #TargetSchemaName#.ARREARS_LETTER_INFORMATION SET LAST_ARREARS_LETTER_TYPE=?,LAST_ARREARS_LETTER_DATE=?,DELETE_FLAG=?,UPDATE_TIMESTAMP =
(select current timestamp from sysibm.sysdummy1) WHERE PART_KEY=? AND COMPANY_CD=? AND CUSTOMER_NBR=? AND BILLING_ITEM_NBR=? AND SEQUENCE_NBR=? AND COUNTRY_CD=?;
But this throws warnings as follows :
DSTAGE-DB2CLI-0103`:`Row rejected.
DBMS.CODE=-99999, SQLSTATE=22001, [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=2200
Also am unable to view data through this DB2 API stage.
Please give me your suggestions.
Regards,
Priya