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 >
Text File  |  1996-02-24  |  703b  |  27 lines

  1. # NOTE: Derived from lib/DB2CLI.pm.  Changes made here will be lost.
  2. package DB2CLI;
  3.  
  4. sub iMessage
  5. {
  6.     my ($henv, $hdbc, $hstmt, $where, $failrc) = @_;
  7.     my ($state, $code, $message, $text);
  8.     my $rc = SQLError($henv, $hdbc, $hstmt, $state, $code, $message);
  9.     $text = "\n$where";
  10.     $text .= "\n\trc=$failrc"
  11.     if $failrc;
  12.     $text .= "\nCannot obtain SQL error message, API rc=$rc:\n"
  13.     if $rc < 0;
  14.     $text .= ", state=$state, code=$code\n$message\n\n";
  15.     if ($failrc >= 0) {
  16.     croak $text;
  17.     return 1;
  18.     }
  19.     SQLTransact($hdbc, SQL_ROLLBACK);
  20.     confess $text;
  21. }
  22.  
  23. #############################################################################
  24. # Connections
  25.  
  26. 1;
  27.