string data right truncation error sqlstate 22001 while working with dbi:db2

I get this kind of error when I try to execute after 
binding parameters.
DBD::DB2::st execute failed: [IBM][CLI Driver]
CLI0109E  String data right truncation. SQLSTATE=22001
at ./dbinit2.pl line 326,  chunk 1.

I am binding around 20 parameters,some of them are of
this type

$sth->bind_param(18,$user_head_desk,SQL_CHAR) || die
$sth->errstr;

could anyone help me regaring this
thank you.



__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
0
prabhakn 10/11/2002 8:45:08 PM
📁 perl.dbi.users
📃 10964 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 793 Views
On 11 Oct, Naveen Prabhakar wrote:
> I get this kind of error when I try to execute after 
> binding parameters.
> DBD::DB2::st execute failed: [IBM][CLI Driver]
> CLI0109E  String data right truncation. SQLSTATE=22001
> at ./dbinit2.pl line 326,  chunk 1.

That error occurs when you have a char or varchar field of a given length,
and you try to put a longer string into it.

You have to truncate the string in Perl (substr can be used for this),
before trying to use it as a placeholder. DBD::DB2 doesn't have an automatic
truncation feature that i know of.

-johnnnnnnnnnnn


0
jmelesky 10/11/2002 8:50:25 PM