OpenDBX/C API/odbx result

From Linuxnetworks
< OpenDBX‎ | C API
Revision as of 19:13, 1 October 2005 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


int odbx_result(
    odbx_t* handle,
    odbx_result_t** result,
    struct timeval* timeout,
    unsigned long chunk )

Description:

Retrieves the result of a query statement from the database server. On success, an dynamically allocated object representing the result ist stored in "result". The third parameter may be NULL to wait until a result arrives or any number of seconds and microseconds in struct timeval to wait for. Dependent on the backend, it may be possible to retrieve all results at once (if "chunk" is zero), one by one or more at once. If paging (more at once) is not supported by the backend, it will use "one by one" or "all at once" if this is the only option provided.

Parameters:

  • handle: Connection object created by odbx_init()
  • result: Pointer to a result pointer
  • timeout: Amount of time before waiting for a result is canceled
  • chunk: Number of rows to fetch at once

Return values:

  • Three if a result is available
  • Two if the query was not SELECT-like
  • One in case of a timeout
  • Zero if no more results are available
  • Less than zero if an error occured

Errors:

  • -ODBX_ERR_PARAM: One of the parameters or its content is invalid
  • -ODBX_ERR_NOMEM: Allocating new memory failed
  • -ODBX_ERR_RESULT: Waiting of result failed
  • -1: Any error retured by the backend



Back to Overview