Hi All,

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:

status= (sword)OCIHandleAlloc((dvoid *)theApp.m_Config.m_pEnv,(dvoid **)&stmthp, OCI_HTYPE_STMT, 0,0);

status= (sword)OCIHandleAlloc((dvoid *)theApp.m_Config.m_pEnv,(dvoid **)&stmthpdata, OCI_HTYPE_STMT, 0,0);

text * get_struktur = (text *) "begin :refcursor:= eds.func_sl_struktur(roject); end;";

ub4 rows = 10;

OCIAttrSet((dvoid *)stmthp, (ub4) OCI_HTYPE_STMT,(dvoid *)&rows, (ub4)sizeof(ub4), (ub4)OCI_ATTR_PREFETCH_ROWS , theApp.m_Config.m_pErr);

status = (sword)OCIStmtPrepare(stmthp,theApp.m_Config.m_pEr r,(text *)get_struktur, (ub4)strlen((const char*)get_struktur), (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);

status = (sword) OCIBindByName(stmthp, bndp, theApp.m_Config.m_pErr,(text*) ":refcursor", (sb4)(strlen(":refcursor")),(dvoid *)&stmthpdata,0,SQLT_RSET,0,0,0,0,0,OCI_DEFAULT);

status = (sword) OCIBindByName(stmthp, bind2, theApp.m_Config.m_pErr,(text*) "roject", (sb4)(strlen("roject")),Project.GetBufferSetLength(Project.GetLe ngth()),Project.GetLength(),SQLT_CHR,0,0,0,0,0,OCI _DEFAULT);

status = (sword)OCIStmtExecute(theApp.m_Config.m_pSvc,stmth p,theApp.m_Config.m_pErr,(ub4)1,(ub4)0,(CONST OCISnapshot *)NULL,(OCISnapshot *)NULL,OCI_DEFAULT);

status = (sword)OCIDefineByPos(stmthpdata,&dfn8p[0], theApp.m_Config.m_pErr, 1, VaterId.GetBufferSetLength(10), 10, SQLT_AFC , 0, 0, 0, OCI_DEFAULT);

status = (sword)OCIDefineByPos(stmthpdata,&dfn8p[1], theApp.m_Config.m_pErr, 2, VaterTyp.GetBufferSetLength(2), 2, SQLT_AFC, 0, 0, 0, OCI_DEFAULT);

status= (sword) OCIStmtFetch2(stmthpdata, theApp.m_Config.m_pErr,1, OCI_DEFAULT, (sb4)0,OCI_DEFAULT);


status= OCIStmtFetch2(stmthpdata, theApp.m_Config.m_pErr,1, OCI_DEFAULT, (sb4)0,OCI_DEFAULT);

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?

Any help will be welcome...
Thanks in advance