Gets row data from a
statement token.
int spqlfetch(void *stmttok, void **bufptr, int *bufsize)
Usage: Fetches the rows returned from executing a statement. Each call
to spqlfetch returns a row from a statement to the caller's buffer.
If
bufptr contains a NULL value, the routine
returns a pointer to a buffer containing the next row. If the value
is not NULL, it assumes that the buffer is owned by the caller and
returns the data to the caller's buffer. In either case,
bufsize is updated with the row length returned. Callers
that use locate-mode spqlfetch semantics (that is, who specify
bufptr as NULL), should NEVER FREE the memory pointer
returned by spqlfetch. A call to spqlfetch(), after all rows for the
statement are returned, returns a
bufsize of 0.
Parameters:
The statement token
to use to access row data from 'select'.
Contains a pointer
to the caller's row buffer to fill with row data. If it is NULL on
entry, it returns a pointer to the internal statement buffer.
Returns the size of
the row buffer that was returned to the caller.
Returns: 0 if successful; SPQL_ENDDATA if the statement has no more rows
to return; SPQL_FETCHFAILED if there is an unexpected failure while
fetching the next row buffer.