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)?
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 Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com