PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
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 4:48PM

Ronald Page wrote:
> 
> > > Inserts that succeed get the same rc as ones that don't (I haven't
> > > tested return codes on Selects).  What am I doing wrong?  TIA.
> >
> > Actually they don't.
> >
> > If ct_results() returns a result type of CS_CMD_FAIL then a flag
> > is set in ct_sql() which forces  RC to be CS_FAIL.
> >
> > What does the SQL look like that fails?
> >
>         $cmd = "insert into ALIAS
>                 (PO_ELECTRONIC_IDENTITY_KEY,
> ALIAS_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?

Michael
-- 
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler