Try chaning these two lines in Oraperl.pm *Oraperl::ora_errno = \$DBD::Oracle::err; *Oraperl::ora_errstr = \$DBD::Oracle::errstr;
to: *Oraperl::ora_errno = \$DBD::err; *Oraperl::ora_errstr = \$DBD::errstr; Tim. On Wed, Sep 10, 2003 at 02:00:28PM -0500, [EMAIL PROTECTED] wrote: > > I am running into a problem where it appears as though the $ora_errno > variable isn't being properly reset after encountering an error. What I am > experiencing is that once $ora_errno and $ora_errstr is set, it stays set > upon additional calls to &ora_bind(). The following code produces the > problem: > > <--- code -- > > #!/usr/local/bin/perl > > use Oraperl; > > $DBH = &ora_login("", "userid/[EMAIL PROTECTED]"); > > #--------------------------------------------------------------------------- > -------------- > #These values should be empty... > print "Error variables before doing anything...\n"; > print "Error code: $ora_errno\n"; > print "Error text: $ora_errstr\n"; > > #--------------------------------------------------------------------------- > --------------- > #First query -- shouldn't produce an error and will return a result. > $sql = "select log_data from log_os where os_id = :1"; > $csr = &ora_open($DBH, $sql); > &ora_bind($csr, '1'); > ($value) = &ora_fetch($csr); > print "\nValue from query 1: $value\n"; > print "\nError variables after basic query 1...\n"; > print "Error code: $ora_errno\n"; > print "Error text: $ora_errstr\n"; > > #--------------------------------------------------------------------------- > --------------- > #Second query -- will produce an error (ORA-01722: invalid number (DBD > ERROR: OCIStmtExecute)) because > #the bind variable isn't the correct type > &ora_bind($csr, 'a'); > ($value) = &ora_fetch($csr); > print "\nValue from query 2: $value\n"; > print "\nError variables after basic query 2...\n"; > print "Error code: $ora_errno\n"; > print "Error text: $ora_errstr\n"; > > #--------------------------------------------------------------------------- > --------------- > #Third attempt -- shouldn't produce an error and will return a result. The > problem, however, is that $ora_errno and $ora_errstr > #still has the previous error AFTER the successful &ora_bind() and > $ora_fetch() call. > &ora_bind($csr, 2); > ($value) = &ora_fetch($csr); > print "\nValue from query 3: $value\n"; > print "\nError variables after basic query 3...\n"; > print "Error code: $ora_errno\n"; > print "Error text: $ora_errstr\n"; > > &ora_close($csr); > print "Logoff of oracle....\n"; > &ora_logoff($DBH); > print "\n"; > > -- end code --> > > Is this possibly an installation/configuration problem? Something else? > > The various versions are: > Oraperl emulation interface version 1.43 > DBD::Oracle 1.14 using OCI8 by Tim Bunce > DBI 1.37 by Tim Bunce > Perl v5.6.0 build for AIX > AIX version 5 > > Thank you for your help. > > ________________________________________ > > This e-mail and any files transmitted with it are confidential and are > intended solely for the use of the individual or entity to whom they > are addressed. If you are not the intended recipient or the individual > responsible for delivering the e-mail to the intended recipient, please > be advised that you have received this e-mail in error and that any > use, dissemination, forwarding, printing, or copying of this e-mail > is strictly prohibited. > > If you have received this e-mail in error, please immediately notify > the HealthPartners Support Center by telephone at (952) 967-6600. > You will be reimbursed for reasonable costs incurred in notifying us.