At 12:13 PM 5/2/2001 -0600, Sterin, Ilya wrote:
>Actually I am not even seeing the error number/message
>
>DBD::Pg::st execute failed: ERRO at init_accounts line 163.
>Unable to insert fundsource (ERRO)
>
>ERRO will not really help us help you.  If that is all you are getting, try
>using trace(2, "file.log") (see docs) to trace the procedures, then send to
>the list.
>
>Ilya Sterin

It sometimes returns 'ERRO' as $dbh->errstr, and sometimes '7'.  I suppose 
it's possible that '7' means something.  I'm not so sure about 'ERRO' - it 
might be the first four characters of 'ERROR 7'.

Here is a test program and the output of 'trace'.

I have melted my eyeballs trying to find a list of numeric error codes in 
the PostgreSQL documentation.

-Rick

----------
#!/usr/common/bin/perl -w

use strict;
#use diagnostics;

use DBI;
use Carp;

# Loads modules from source directory if executed in source directory
use lib qw(. /usr/local/netprint/testlib);
use npstdlib;
use netprintdb;

$| = 1;

# Connect to the database
my($dbspec, $user, $password) = dbparams();
my($dbh);
$dbh = DBI->connect($dbspec, 'rcc2', '', { AutoCommit => 1 })
     or die "Unable to connect to '$dbspec' ($DBI::errstr)\n";

$dbh->trace(2, "bug.log");

my($table) = 'Superscriptions';
$dbh->do("DROP TABLE $table")
     or carp "Unable to DROP TABLE $table (".$dbh->errstr.")\n";

$dbh->disconnect;

exit(0);

----------

     DBI::db=HASH(0x2030f9fc) trace level set to 2 in DBI 1.13-nothread
     -> do in DBD::_::db for DBD::Pg::db 
(DBI::db=HASH(0x2030fa14)~0x2030f9fc 'DROP TABLE Superscriptions')
2   -> prepare for DBD::Pg::db (DBI::db=HASH(0x2030f9fc)~INNER 'DROP TABLE 
Superscriptions' undef)
dbd_st_prepare: statement = >DROP TABLE Superscriptions<
dbd_st_preparse: statement = >DROP TABLE Superscriptions<
2   <- prepare= DBI::st=HASH(0x2030fb28) at DBI.pm line 900.
     -> execute for DBD::Pg::st (DBI::st=HASH(0x2030fb28)~0x2030fb70)
dbd_st_execute
dbd_st_execute: statement = >DROP TABLE Superscriptions<
  error 7 recorded:
     !! ERROR: 7 ''
     <- execute= undef at DBI.pm line 901.
     !! ERROR: 7 ''
     <- do= undef at bug.pl line 25.
     -> errstr in DBD::_::common for DBD::Pg::db 
(DBI::db=HASH(0x2030fa14)~0x2030f9fc)
     <- errstr= 7 at bug.pl line 25.
     -> DESTROY for DBD::Pg::st (DBI::st=HASH(0x2030fb70)~INNER)
dbd_st_destroy
     <- DESTROY= undef at bug.pl line 28.
     -> disconnect for DBD::Pg::db (DBI::db=HASH(0x2030fa14)~0x2030f9fc)
dbd_db_disconnect
     <- disconnect= 1 at bug.pl line 28.
     -> DESTROY for DBD::Pg::db (DBI::db=HASH(0x2030f9fc)~INNER)
dbd_db_destroy
     <- DESTROY= undef at unknown location!

Reply via email to