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
Updating DB2 server timestamp through Userdefined SQL
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is not a problem with the timestamp unless UPDATE_TIMESTAMP has a string data type. Please verify that. Otherwise, it is one of your Char or VarChar fields that is throwing this error. (The error message specifies "string data right truncation".)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.