|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
String Data Right Truncation Error |
« View previous topic :: View next topic » |
Author |
Message
|
jansjsj |
Posted: Mon May 16, 2011 1:11 am Post subject: String Data Right Truncation Error |
|
|
Newbie
Joined: 18 Apr 2010 Posts: 5
|
Hi,
Am trying to store date and time values in Database (DB2) using stored procedure.
Here is what I have done,
Passing a variable of TIMESTAMP datatype in esql of value CURRENT_TIMESTAMP.
The column in DB table is also capable of holding timestamp, same applied to Stored Procedure as well.
While testing, 'String Data Right Truncation Error' exception is thrown.
Whereas when I try to insert the same timestamp manually into the DB.. all works fine.
It would be gr8 if anyone can commit on this problem/highlight if I have overlooked any detail in this error.
Regards,
Jan |
|
Back to top |
|
 |
kimbert |
Posted: Mon May 16, 2011 3:25 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please quote the entire error message, and tell us which component in your system emitted the message. |
|
Back to top |
|
 |
jansjsj |
Posted: Wed May 18, 2011 6:51 pm Post subject: Here it is... |
|
|
Newbie
Joined: 18 Apr 2010 Posts: 5
|
kimbert wrote: |
Please quote the entire error message, and tell us which component in your system emitted the message. |
Error is thrown when the flow traverses through the procedure calling StoredProcedure(SP) in a compute node.
Here is the code snippet,
Code: |
DECLARE timeVar TIMESTAMP CURRENT_TIMESTAMP;
-- Call Stored Procedure to insert into DB
CALL Err_SP (timeVar,charServiceId,charExceptionCode,charExceptionDesc,charClipId);
CREATE PROCEDURE Err_SP (IN E2 TIMESTAMP, IN E3 CHARACTER, IN E4 CHARACTER, IN E5 CHARACTER, IN E6 CHARACTER)
LANGUAGE DATABASE
EXTERNAL NAME "SP"; |
Error Msg : [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
BIPmsg : 2322
Please let me know if any other detail is required.
Thanks,
Jan |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed May 18, 2011 10:56 pm Post subject: Re: Here it is... |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
jansjsj wrote: |
[IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
|
This is fairly self explanatory. The data you are trying to insert is larger than the DB colum that it is destined for.
Take a user trace (NOT DEBUG). look at each field and count the characters.Then compare them to the data in the various columns of the table.
One trick to avoid this happening in the first place is to put a SUBSTRING around every parameter (well the CHAR ones at least) to ensure that you don't even try to insert a 50character string into a varchar(20) column. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
jansjsj |
Posted: Sun May 29, 2011 7:42 pm Post subject: |
|
|
Newbie
Joined: 18 Apr 2010 Posts: 5
|
Sorry for the delayed reply.
Thanks and I got rid of the trouble. _________________ Regards,
Jan |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|