[unixODBC-support] Problem in using cursor to fetch millions of rows

Eric Sharkey sharkey at netrics.com
Wed Apr 6 20:57:32 BST 2005


> Hi,
> 
> I'm very appreciated the help here. I read the source code in the execute met
> hod, the line that is suspicious to me in the void TclSqlStatement::Execute(T
> cl_Interp *interp, int objc, TCL_CMDARGS) is this:
> 
> while ((rc = SQLExecute(stmt)) == SQL_STILL_EXECUTING) SqlWait(1);

This looks ok.  If the statement is being executed asynchronously,
then SQLExecute will return SQL_STILL_EXECUTING until the execution
is done, at which point it will return SQL_SUCCESS, SQL_ERROR or something
in between.

If the statement is not being executed asyncrhonously, then SQLExecute
will never return SQL_STILL_EXECUTING, so that loop just executes
the statement once and moves on.

Basically, this loop makes it effectively synchronous, regardless of
whether or not the driver is running in a synchronous or asychronous mode.

Whatever your problem is, it isn't there.

Eric



More information about the unixODBC-support mailing list