Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetch returns no of rows?

Status
Not open for further replies.

nkm

Programmer
May 27, 2001
45
0
0
US
Does the Fetch operation return the no of rows matching the select criteria or only the number of rows buffered in this operation which could be less then the number of rows that acutally match the select criteria?

 
Hi,

A fetch operation is supposed to return rows according to the where clause of the select a statement. The machanism is designed such a way that the rows are searched in the buffer area first, to reduce the disk I/O; which improves the performance.

In reality, it might happen that certain portions of rows are fetched from the buffer area and the balance rows are gathered from the non-buffered area (disk), according to the (non)availability cached information.

The bottom line is: you get result according to the where clause, that actually matches the data stored in database tables. Buffering or caching improves this operation.

Regards
Shriyan
 
Hi

Sorry if my question was not very clear what I wanted to know was on a fetch operation sqlca.sqlerrd[2] has a count of records fetched.

Is this count equal to the select criteria or the number of records buffered.

Can I use this value safely instead of making a
count(*) SQL with the same select criteria

regards

 
Hi:

>Can I use this value safely instead of making a
>count(*) SQL with the same select criteria

Yes.

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top