Subject | Re: [ib-support] How many rows were affected? |
---|---|
Author | Paul Reeves |
Post date | 2001-05-07T18:38:01Z |
Nando Dessena wrote:
the delete goes ahead you will touch each row twice.
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further
>It has to be, by nature of the way count works - it will count each row - so if
> Ann,
>
> > >if I issue an update or delete statement inside a stored procedure, and
> > >want to know how many rows the statement has affected *from within the
> > >SP code*, is there a way?
> > >I know the information is accessible via the API, I just need it in the
> > >SP.
> >
> > Given the way the engine works, updating or deleting in a for select
> > loop is very nearly as fast as a mass update or delete. Since the
> > procedure succeeds or fails as a unit, you get the same statement
> > level error unwind. So, just do a for select and keep a count.
>
> thanks; I assume this will be faster that doing a select count() first
> and then the actual delete, isn't it?
the delete goes ahead you will touch each row twice.
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further