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: sy50027 at milton dot sbi dot com (Simon Yaminian)
Subject: Re: Obtaining rowcount when updating
Date: Sep 24 1998 8:51PM

> From owner-SYBPERL-L@listproc.net Thu Sep 24 15:00:09 1998
> From: Michael Peppler 
> Mime-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Date: Thu, 24 Sep 1998 11:31:27 -0700 (PDT)
> To: SybPerl Discussion List 
> Subject: Obtaining rowcount when updating
> X-Listprocessor-Version: 8.2.07 -- ListProc(tm) by CREN
> 
> Simon Yaminian writes:
>  > Hello,
>  > 
>  >    I noticed that when updating a table, $dbh->dbresults call does not return
>  > "NO_MORE_RESULTS" but the first $dbh->dbnextrow call returns NULL. Anyone knows
>  > the reasoning behind this? Also with this setup, how can we get the count of
>  > all rows affected in the update process?..
> 
> Perfectly normal.
> 
> The first dbresults() is for the actual insert, and on an insert there 
> are no rows, so dbnextrow() returns an empty array.
> The second call to dbresults() will return NO_MORE_RESULTS (if there
> was only one insert statement).
> 
> YOu get the number of rows affected with DBROWS.
> 
> Michael
> -- 
> Michael Peppler         -||-  Data Migrations Inc.
> mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
> Int. Sybase User Group  -||-  http://www.isug.com
> 
> 
Thanks for your reply;

   I tried getting the number of rows using $dbh->DBCOUNT after an update
and it returned 0. Even with the insert, it returned 0.

   Is there any other consideration I am not aware of.

Regards
Simon Yaminian