Updating DB2 server timestamp through Userdefined SQL

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mchivuku
Participant
Posts: 21
Joined: Sat Feb 04, 2006 7:38 am

Updating DB2 server timestamp through Userdefined SQL

Post by mchivuku »

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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What happens when you just do UPDATE_TS = current timestamp ???
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mchivuku
Participant
Posts: 21
Joined: Sat Feb 04, 2006 7:38 am

Post by mchivuku »

It throws the same error even when I use only current timestamp
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
Post Reply