|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: DBLib sql method & error handling
Date: Jun 3 1998 6:54PM
Wechsler, Steven M writes:
> How can you trap SQL errors when using the sql method? Are the two
> mutually exclusive, or am I doing it wrong?
>
> Here's what I'm doing:
>
> #! /usr/local/bin/perl5
> use Sybase::DBlib;
>
> [get $server, $password, $dbname]
> $handle = new Sybase::DBlib "sa", $password, $server ||
> die "Unable to open connection to $server\n";
> $handle->dbuse($dbname) || die "Unable to USE $dbname\n";
>
> dberrhandle("error_handler");
You need to install a "message handler". The "error handle" traps
errors at the DBlibrary level, or at the OS level on the Client. The
"message handler" traps SQL errors and the like, ie "messages" from
the server.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@datamig.com -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
|