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_fetch() with a stored proc.
Date: Jan 7 2002 5:39PM

Monty Charlton writes:
 > Hello,
 > 
 > My stored proc. should return only one row of data, but ct_fetch() loops 
 > three times.  Plus, if I try to ct_cancel it, I get an error.  What could I 
 > possibly be doing wrong:

You're not doing anything wrong - you're just not realizing that the
stored proc will also return the status result (CS_STATUS_RESULT),
which is a one row result with the return code from the proc (usually
0, unless the proc fails or you use an explicit RETURN statement).

In addition you have one parameter specified as CS_RETURN, so that
will generate a CS_PARAM_RESULT (from the parameter declared OUTPUT in
the proc definition).

So that is why you get the three results - which you should fetch, and
possibly discard if you don't need them.

Michael
-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler@peppler.org - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com