Posted: Mon Sep 08, 2003 11:47 am Post subject: Eror Inserting current_timestamp into Oracle
Master
Joined: 21 Nov 2002 Posts: 200
HI! I have a message flow that needs to insert the current date and time into an Oracle table. I set a variable equal to current_timestamp and try to insert that value. I get an Oracle error stating that the value is too large for the column. The reason is that the value of the variable looks like the following after assigning it to current_timestamp:
Is there a way to strip off the word 'TIMESTAMP' and the escape sequence for the apostrophy so that the MODDATETIME tag contains just the date and time before inserting into Oracle?
Unfortunately there is no built-in functionality to do this for you. You will need to CAST your resultant timeStamp to a CHARACTER variable, and then use the SUBSTRING function to get the portion of the TIMESTAMP you require. I have seen other solutions where the database manager in question supports functions that can also give the current date/time, and the PASSTHRU function has been called, and these functions have been embedded in the Database call. This approach also works, but can limit your ESQL to communicating with one type of database manager that has to support these SQL functions. _________________ Regards
Craig
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum