ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » String Data Right Truncation Error

Post new topic  Reply to topic
 String Data Right Truncation Error « View previous topic :: View next topic » 
Author Message
jansjsj
PostPosted: Mon May 16, 2011 1:11 am    Post subject: String Data Right Truncation Error Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Mon May 16, 2011 3:25 am    Post subject: Reply with quote

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
View user's profile Send private message
jansjsj
PostPosted: Wed May 18, 2011 6:51 pm    Post subject: Here it is... Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Wed May 18, 2011 10:56 pm    Post subject: Re: Here it is... Reply with quote

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
View user's profile Send private message
jansjsj
PostPosted: Sun May 29, 2011 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » String Data Right Truncation Error
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.