home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
perl502b.zip
/
lib
/
auto
/
DB2CLI
/
iMessage.al
< prev
next >
Wrap
Text File
|
1996-02-24
|
703b
|
27 lines
# NOTE: Derived from lib/DB2CLI.pm. Changes made here will be lost.
package DB2CLI;
sub iMessage
{
my ($henv, $hdbc, $hstmt, $where, $failrc) = @_;
my ($state, $code, $message, $text);
my $rc = SQLError($henv, $hdbc, $hstmt, $state, $code, $message);
$text = "\n$where";
$text .= "\n\trc=$failrc"
if $failrc;
$text .= "\nCannot obtain SQL error message, API rc=$rc:\n"
if $rc < 0;
$text .= ", state=$state, code=$code\n$message\n\n";
if ($failrc >= 0) {
croak $text;
return 1;
}
SQLTransact($hdbc, SQL_ROLLBACK);
confess $text;
}
#############################################################################
# Connections
1;