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: Stored proc result sets
Date: Jun 4 1998 5:32PM

Mick Ghazey writes:
 > We have a stored procedure that prints messages to stdout. Will these
 > messages be returned as in the result set(s)?

As in

	print "this is a message from the sproc"

?

If so these are routed to the client's message handler. Please see
sybutil.pl or ctutil.pl (in the lib directory of the Sybperl
distribution, also in the $PERL5LIB/site_perl directory if sybperl has
been normally installed). Also see the discussion on message handlers
in (or server callbacks) in teh Sybase OpenClient docs).

 > 
 > How do I know how many result sets a stored procedure returns?

You won't know until you run the sproc. In addition the number of
result sets can very well be variable. So you should code your
programs to be able to handle an unknown number of result sets, by
looping over dbresults() until it returns NO_MORE_RESULTS, or by
looping over ct_results() until it stops returning CS_SUCCEED.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com