Error variable value after execute

Error variable value after execute

am 28.09.2005 20:46:54 von jainabhay

The following statement (trying to insert a duplicate row)
$sth->execute() or die "could not execute insert: $sth->errstr\n";
returns a value of DBI::st=3DHASH(0x14065d780)->errstr for $sth->errstr.
Is that normal.
Moreover prints a long error message on screen (STDERR).
How do I capture that?

Abhay

RE: Error variable value after execute

am 28.09.2005 20:51:22 von Ron.Reidy

The docs are your friend ...

http://www.perl.com/doc/manual/html/pod/perlfunc/die.html

As for the funky "DBI::st=3DHASH ...", try 'die "message: ",
$sth->errstr;' or 'die "message: $DBI::errstr";

--
Ron Reidy
Lead DBA
Array BioPharma, Inc.

-----Original Message-----
From: Jain, Abhay K, ALABS [mailto:jainabhay@att.com]=20
Sent: Wednesday, September 28, 2005 12:47 PM
To: dbi-users@perl.org
Subject: Error variable value after execute


The following statement (trying to insert a duplicate row)
$sth->execute() or die "could not execute insert:
$sth->errstr\n"; returns a value of DBI::st=3DHASH(0x14065d780)->errstr
for $sth->errstr. Is that normal.
Moreover prints a long error message on screen (STDERR).
How do I capture that?

Abhay


This electronic message transmission is a PRIVATE communication which =
contains
information which may be confidential or privileged. The information is =
intended=20
to be for the use of the individual or entity named above. If you are =
not the=20
intended recipient, please be aware that any disclosure, copying, =
distribution=20
or use of the contents of this information is prohibited. Please notify =
the
sender of the delivery error by replying to this message, or notify us =
by
telephone (877-633-2436, ext. 0), and then delete it from your system.