|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Obtaining rowcount when updating
Date: Sep 24 1998 6:31PM
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
|