|XP is just a number|
RESOLVED - DBD::Oracle::st fetchrow_hashref failed: ORA-25401by perldigious (Priest)
|on Jan 29, 2020 at 20:22 UTC||Need Help??|
perldigious has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Monks. I'm going to start by explaining my original problem (as this node is titled) to make sure I'm not doing the XY thing. This is my second day ever messing around with the Perl DBI, so I admit to all ignorance in advance and as always that I'm no power user of Perl in general.
I started getting the title error when attempting to retrieve some data from my employer's Oracle database. It seems to consistently hang on one of two rows as it's fetching them (it successfully retrieves many), then throws the error code. I think I can safely say the issue is with the script I've written, or not having set something up correctly, since I'm able to run the same query just fine in an SQL Developer environment using the same connection string. The code snip it's hanging on is pretty simple...
I found this node of nearly the same title and attempted to follow the basic advice of updating my DBD::Oracle module install, but when I try that seems to be having a problem executing on my machine. Here's a screen dump of what's happening, not sure what I need to do here.
Any help any Monk can provide is much appreciated, at this point I'm running down random Google search holes that all seem to lead nowhere.
UPDATE: For posterity's sake (and mine if I ever have to refer back)
Unfortunately I don't have a "root cause" as to why I was seeing this error, but I do at least seem to have a fix for it. When I added some CAST and TRIM functions around the the more exotic data fields all the problems went away. With just CAST they mostly went away, but it would still freeze up on occasion. The intermittent nature of the failures was/is the most disconcerting thing about them... inconsistency when running the same script with the same SQL was very vexing to me. I'm not even certain where exactly the problem was (The database? DBI? DBD::Oracle? My terminal?).
I had gotten a bit sidetracked with a different issue that I wanted to resolve first since it was slowing down my debugging terribly.
Thank you to all the esteemed Monks who helped me get this figured out, it's very much appreciated:
Now I'm off to pick more fights with the Perl DBI where I muddle the line between winning and losing. :-)
UPDATE - Resolved: See update at bottom of post here.
Just another Perl hooker - My clients appreciate that I keep my code clean but my comments dirty.