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 peppler dot org>
Subject: Re: ct_sql error checking
Date: Jul 26 1999 9:50PM

Jie Gao writes:
 > Hi All,
 > 
 > I have been trying to get error checking for ct_sql work, but I am
 > lost:
 > 
 > I'm using an insert statement, like:
 > 
 >     $statem = "INSERT into afm.em (em_id, phone, email) VALUES ('john', '15655', 'johne@xxx.xxx.xx')";
 >     $ret = $dbh->ct_sql($statem);
 > 
 > What I use to check whether the transaction is successful, is the
 > following (what I understand it to be from reading the Sybase::CTlib
 > manual:

I've not looked into this exact behaviour in a while.

If you want to do extensive error checking I would strongly recommend
that you use the ct_execute/ct_results/ct_fetch calls directly.

Also, on a different note: in my humble opinion it's in *general* not
a good thing to do begin tran/commit tran in the client. It's a lot
better to move everything, including the transaction, into a stored
proc.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com