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: Tony Wong <tony at dragon dot vi dot net>
Subject: Linux Sybperl and Error handling
Date: Sep 15 1997 12:20PM

I'm writing a Web interface using Sybperl for Linux (and hence only have CTlib
available). I want all the routines in the API that I am writing to return
values so indicate whether or not SQL queuries were executed without any 
problems. 

Forgive my ignorance but I am confused by all the documentation explaining
errors and how to handle them. Of course, ct_execute returns a value but I 
find that it does not properly reflect what actually happened. 

Sometimes I will put SQL "insert" statements through, which won't work but
ct_execute returns CS_SUCCEED. At the moment, my workaround is to use a 
procedure solely to execute the query that sets a STATUS value prior to calling
ct_execute. Then if any errors occur, the callback routine will modify the
STATUS variable which is then returned to the calling function.

My concern now is that should I being doing anything with $ret where 
 $ret = $dbh->ct_execute($sql);

because I'm now using the STATUS value as described above. In addition, am I
going about this in the right way? I have a feeling that my method is flawed.

Many thanks in advance for any help.

ttfn,

Tony

tony@dragon.vi.net