Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: ct_sql and v2.08
Date: Dec 3 1997 11:06PM

Ronald Page wrote:
> > > > What does the SQL look like that fails?
> > > >
> > >         $cmd = "insert into ALIAS
> > >                 (PO_ELECTRONIC_IDENTITY_KEY,
> > >                 CREATED_BY, CREATE_DATE) values
> > >                 ($poIdNum, $idNum, \"EPO\", \"$datestr\")";
> > >         $ref = $appo->ct_sql($cmd);
> > >
> > >         print "$appo->{'RC'} \n";
> >
> > The command can only fail due to a communication or hardware
> > error, unless there is a trigger or constraint on the table.
> >
> > Is there a trigger on the table that could cause the insert to
> > fail? Possibly with a raiserror?
> >
>         Yes, there is a trigger (generated by S-Designor) and it uses
> "raiserror", and that trigger is why the insert is failing.  I thought I
> was thinking that error would be returned.  Is there a way to capture
> those (raiserrors)?  Thanks.

The raiserrors should appear in the server callback. They will usually
not cause the command to fail visibly in the CTlib calls themselves
because they aren't "real" errors (or at least that's they way
I interpret this.)

So you need to write an error handler (server callback for
CTlib) which catches the error messages that raiserror outputs.

Michael Peppler       -||-  Data Migrations Inc.  -||-