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

> From 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.
>       -||-
> Int. Sybase User Group  -||-
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.

Simon Yaminian