I am having problems setting the attribute OCI_ATTR_PREFETCH_ROWS. I need to set the value of this attribute in order to decrease the number of trips to the server. Until now I am having one row per trip and this causes my application to be very slow on some cases, so I need to set this value to a higher values. I have tried this for a time but I have get no result... the applications always brings one row per trip.....
Here is a resume of my code:
Thanks for your answer...I have just tried your solution but it is still not working, just one row is fetched.
Have you seen I have two OCIStmt variables: stmthp and stmthpdata. The second one is "linked" to the first OCIBindByName SQLT_RSET... but the OCIAttrSet is done on stmthp...maybe there is a problem here...I have tried also to set the attribute to stmpthpdata but is not working also...any other idea?
I have just read this on another post: when ref cursor is used in a stored proc as out parameter, setting the prefetch attribute has no affect. For ref cursor, does it always fetch the row from the server for each OCIStmtFetch2 call, even when prefetch count is set.
Is there any possiblity to prefetch rows when using ref cursors?