Page 1 of 1

DB2 sparse lookup column length problem

Posted: Thu Dec 13, 2007 9:06 am
by Mat01
Hi All,

I just ran into a problem that seems to be a bug. I think I found the source but I'll share this so I might save you some research time or you might have a different view on the issue.

While doing a sparse lookup in DB2 , I got the following error:
Additional info after successful execution of DB2-CLI request; SQLSTATE = 01004; NativeErrorCode = -99999
[IBM][CLI Driver] CLI0002W Data truncated. SQLSTATE=01004
The following message was:
Error when checking operator: Could not find input field "My field name here"
I know that nothing was wrong with the SQL and if I removed this field, the statement executed fine. I found that the problem was because my field name was too long (30 chars). I changed the SQL to rename my field to something shorter (<My field> as <something shorter>) and it worked.

Conclusion: short names are better...

Regards,

Mat

Posted: Thu Dec 13, 2007 5:59 pm
by ray.wurlod
Most databases have limits on identifier names. Under the ODBC standards it's 18 characters.