Oracle Dabase entry fetching : ofetch() Vs ofen() OCI calls


Ofetch() call used for single row fetch,and ofen() call used to fetch multiple rows at a time.

Its depends on application how they r useful.
If we want to fetch only one row we can go for ofetch call,But whenever multiple rows r needed to fetch ofetch is not correct one.Even if we call it multiple times to fetch multiple rows ,it will turn a performance drawback.

There is solution,ofen() call to fetch thousands of rows at a single call and it gives unbelievable performance in fetching rather going for ofetch() call repeatedly..

There is one more call OEXFET,which gives combined functionality of OEXEC and ofen/ofetch into a sngle call.
OEXFET can execute the statement, fetch data from one or multiple rows into scalar or array variables in program, and, optionally, cancel the cursor (releasing resources) when the fetch completes. You can combine a deferred parse (using OPARSE) and deferred binds and defines with OEXFET to perform a complete query operation, from statement parse to canceling the cursor, in one call to the Oracle server.


About ofen call we can get info@
http://www5.ncdc.noaa.gov/docs7.0/api/doc/OCI73/ch4a.htm#odescr
http://www5.ncdc.noaa.gov/docs7.0/api/doc/OCI73/ch2.htm
and @
http://www.lsbu.ac.uk/oracle/oracle7/api/doc/OCI73/apa1.htm