View previous topic :: View next topic |
Author |
Message |
gans79 Beginner
Joined: 31 Aug 2005 Posts: 51 Topics: 27
|
Posted: Fri Jul 18, 2008 2:39 am Post subject: No of rows returned by a cursor |
|
|
Hi,
I there a way to find the no of rows returned by a cursor without executing a Count(*), I beleive there is a SQLCA variavle sqlerrd(3) which returns no of rows inserted/updated not sure if it will return for a select ,
Thanks
Ganesh |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Fri Jul 18, 2008 2:57 am Post subject: |
|
|
Short answer: No, there isn't.
But you could count your number of fetches.
regards
Christian |
|
Back to top |
|
 |
Eric.C.Bakke Beginner
Joined: 14 Jul 2008 Posts: 15 Topics: 0 Location: Plano, TX
|
Posted: Fri Jul 18, 2008 3:14 pm Post subject: |
|
|
If you are on DB2 V8 NFM or above, you could do a multi-row fetch in a cursor (better performance) where you can and will want to evaluate sqlerr3 for the number of rows returned in a single multi-row fetch. I highly recommend this approach over using single row fetch methods of the past for 100 rows of data or more.
Singleton inserts, updates, and deletes can be done in a multi-row fashion as well and it will dramatically improve bulk processing. _________________ Eric C. Bakke
Senior DB2 DBA |
|
Back to top |
|
 |
|
|