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: Re: Obtaining rowcount when updating
Date: Sep 29 1998 3:22PM

David C Worenklein writes:
 > >>>>> "Michael" == Michael Peppler  writes:
 >     Michael>  Simon Yaminian writes:
 >     Michael>  Perfectly normal.
 >     Michael> 
 >     Michael> The first dbresults() is for the actual insert, and on an
 >     Michael> insert there are no rows, so dbnextrow() returns an empty
 >     Michael> array.  The second call to dbresults() will return
 >     Michael> NO_MORE_RESULTS (if there was only one insert statement).
 >     Michael> 
 >     Michael> YOu get the number of rows affected with DBROWS.
 > 
 > Watch out for insert triggers - they can trigger dbresults.

I knwo they used to (I got bitten by that back in 1989 - on 4.01 :-),
but I had a feeling that this was not the case in more recent versions 
of Sybase.

Notwithstanding the above statement (how's that for pedantic :-) you
should *always* call dbresults() in a loop until it returns
NO_MORE_RESULTS. 

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