in reply to get rowid for failed records using dbi
You may try watching what is returned in $sth->err and $sth->errstr, may contain the id or some indication of the position on the dataset where the error ocurred.
The use of parens around @cols may be redundant and can (IMHO), give troubles as it may be creating an anonymous list (at least it's what it does when you use ($v1,$v2)=sub_returning_array). Also, the use of shift can clarify your code a little. Try:
while(@cols=$sth->fetchrow_array) { $cur_rowid = shift @cols if $row_id; print OFILE join("$delimiter", @cols), "\n"; ] if($sth->err) { print "$sth->errstr\n"; }
Please note that this is a blind shot as I don't have Oracle and, as you may note, I'm just an average Perl programmer, but this may be of help (I think ;)
If that does not give the results you want, you may try using the HandleError hook of DBI. Looking at the documentation it says that the sub defined this way receives, as a third argument, the "first value being returned by the method that failed". Who knows, that may be the rowid you want. ;)
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: get rowid for failed records using dbi
by ctaustin (Sexton) on Jul 17, 2005 at 16:39 UTC |