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: ROW_COUNT Question
Date: Sep 19 2002 9:22AM

On Wed, 2002-09-18 at 12:37, Stern, Meir wrote:
> I am trying to get the ROW_COUNT based on a ct_sql call which I exec a
> stored procedure that returns rows of data. for some reason when ever I try
> to print out the ROW_COUNT it comes up with a -1 instead of the amount of
> rows. My undarstanding is that ROW_COUNT gets set automatically with a
> ct_sql call.

I think you are hitting a bug, or maybe an unintended behavior.

ct_sql() does set the row count, but it only sets it at the end of the
command (I think), rather than when a query is done within the batch.
When you execute a stored procedure there are more than one result set,
and this means that the ROW_COUNT value will be set to the last result
set, which is normally the stored procedure's status result.

I'll have to look at the code to see if there is a way to make that work
better.

Michael
-- 
Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!