Hey all, I (my boss actually) has run across a problem using perl with DB2 that i have no good answer for. Running a SELECT query thats grabs some data that includes a column defined as DECIMAL(14). When the $handle->fetchrow_array() occurs, we get the following error:
DBD::DB2::st fetchrow_array failed:
IBMCLI DriverDB2/SUN64 SQL0413N Overflow occured during numeric data type conversion. SQLSTATE=22003
My initial guess was that the 14 digit decimal is too big for perl, but i dont think so.
I have never encountered dealing with data retrieval errors, just with execute() errors. Any insight into dealing with this would help. I've also had some (seemingly) inconsistent behaviour with toggling the RaiseError flag on the DB connection, and trying to trap errors with eval{}.
Sorry if this sounds a bit disoriented, i feel a bit disoriented about this. If you need more info, please ask.
I have a lot of experience with DBD::MySQL, but have almost no experience with DBD::DB2 so i'm a bit lost.
Regardless, that may have nothing to do with this.
Update:
Reading O'Reilly's Programming the Perl DBI, i see in Appendix B, section DBD::DB2 (page 246 in my copy), the stateemnt
notice that DB2 supports numbers outside the typicalvalid range for perl numbers. This isn't a major problem because DBD::DB2 always returns all numbers as strings.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.