Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Chris Jack" <jackc at rabo-bank dot com>
Subject: RE: DBCOUNT
Date: Nov 30 1998 10:06AM

There is a change request to Sybase in here.

Sybase (and Oracle) should both know how many rows are in the result set if 
you have done something that requires a work table. For example when you do 
an appropriate sort or an amalgamation. I believe SQLBase (which has a 
better concept of a result set than Sybase/Oracle) has this facility. It 
may be that there are technical reasons why this is hard for certain 
physical database configurations specific to Sybase however... you could 
have a call that returned the number of rows when it is possible or an 
unavailable flag (plus a disclaimer in the documentation about the 
limitations of usage).


-----Original Message-----
From:	Michael Peppler []
Sent:	Friday, November 27, 1998 5:27 PM
To:	SybPerl Discussion List
Subject:	DBCOUNT

Dave Waller writes:
 > I must be using this wrong because I get -1 for the value.
 > So..  How do you really use DBCOUNT

[ I think I'm going to write an autoresponder that replies to DBCOUNT
  queries automatically... ]

DBCOUNT() returns the number of rows affected for update/insert/delete

For select statements all the rows need to be processed (via
dbnextrow) before DBCOUNT() can return the correct value. This is
normal and is due to the way RDBMS engines handle datasets internally
(ie the information is not available) This BTW is not a Sybase
limitation, Oracle works the same way.

Michael Peppler         -||-  Data Migrations Inc.       -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: