views:

60

answers:

2
my ($ret) = $l_dbh->selectrow_array("select dummy from "
                        . $l_dbh->quote_identifier($dblink, 'SYSIBM', "SYSDUMMY1") );
                          $ret;
                           };
+3  A: 

Your question is hardly clear, but it sounds like you're looking for the DBI error attributes: err (the native database error code), errstr (the native database error message), and state (a standard SQLSTATE five character format, but not widely supported).

cjm
A: 

I think what you want is to follow your statement with:

my $sqlerr = $l_dbh->errstr;

However, you may not get that far if $l_dbh->{RaiseError} is set, as that will cause your program to crash on any error (with the error message). So you will want to do a

$l_dbh->{RaiseError} = 0;

first

jimbob