Main Page | Modules | File List | Globals | Related Pages | Examples

Miscellaneous functions


Functions

int sqlo_get_oci_handle (int sqloh, void *ocihp, sqlo_oci_handle_types_e type)
 Get the specified OCI handle.
int sqlo_get_db_handle (sqlo_stmt_handle_t sth)
 Return the database handle of a statement handle.
int sqlo_set_blocking (sqlo_db_handle_t dbh, unsigned int on)
 Set OCI blocking mode on/off.
int sqlo_get_blocking (sqlo_db_handle_t dbh, unsigned int *blocking)
 Get OCI blocking mode.
int sqlo_break (sqlo_db_handle_t dbh)
 Abort all operations in non-blocking mode.
int sqlo_set_prefetch_rows (sqlo_stmt_handle_t sth, unsigned int nrows)
 Set the prefetch row attribute for a statement.
int sqlo_server_version (sqlo_db_handle_t dbh, char *bufp, unsigned int buflen)
 Get the server version string.
int sqlo_get_stmt_state (sqlo_stmt_handle_t sth)
 Get the state of the statement.
const char * sqlo_get_stmt (sqlo_stmt_handle_t sth)
 Get the sql statement text for the statement handle.
int sqlo_get_ocol_dtype (sqlo_stmt_handle_t sth, unsigned int pos)
 Get the datatype of a column in the select list.
int sqlo_trace (sqlo_db_handle_t dbh, int on)
 Switches Oracle trace on/off.
int sqlo_print (sqlo_stmt_handle_t sth)
 Print info about the statement to stdout.
int sqlo_register_int_handler (int *handle, sqlo_signal_handler_t signal_handler)
 Register a signal handler for interrupts.
int sqlo_clear_int_handler (int handle)
 Clear an interrupt handler.

Function Documentation

int sqlo_break sqlo_db_handle_t  dbh  ) 
 

Abort all operations in non-blocking mode.

This call performs an immediate (asynchronous) abort of any currently executing OCI function that is associated with a connection.

If the connection is in blocking mode, SQLO_SUCCESS is returned without doing an abort.

The cursor in "SQLO_STILL_EXECUTING" status is closed.

Parameters:
dbh A database handle
Returns:
  • SQLO_SUCCESS
  • SQLO_ERROR
  • SQLO_INVALID_DB_HANDLE
Since:
Version 2.2

int sqlo_clear_int_handler int  handle  ) 
 

Clear an interrupt handler.

Parameters:
handle I - The handle created by sqlo_register_int_handler.
Returns:
SQLO_SUCCESS or SQLO_ERROR on error.

int sqlo_get_blocking sqlo_db_handle_t  dbh,
unsigned int *  blocking
 

Get OCI blocking mode.

Returns the the blocking mode.

Parameters:
dbh I - A database handle
blocking O - SQL_ON if in blocking mode (database default), or SQLO_OFF if in non-blocking mode.
Returns:
SQLO_SUCCESS or OCI status code.
Since:
Version 2.2

int sqlo_get_db_handle sqlo_stmt_handle_t  sth  ) 
 

Return the database handle of a statement handle.

Parameters:
sth I - A statement handle
Returns:
  • The database handle
  • < 0 on error

int sqlo_get_oci_handle int  sqloh,
void *  ocihp,
sqlo_oci_handle_types_e  type
 

Get the specified OCI handle.

You can get the oci handles here, if you want to call other OCI functions.

Parameters:
sqloh I - Either a statement or a database handle depending on the handle type you want to get.
ocihp O - The requested OCI handle.
type I - The OCI handle type (see sqlo_oci_handle_types_e)
Returns:
  • SQLO_SUCCESS
  • < 0 on error
See also:
sqlo_oci_handle_types_e

int sqlo_get_ocol_dtype sqlo_stmt_handle_t  sth,
unsigned int  pos
 

Get the datatype of a column in the select list.

Parameters:
sth I - The statement handle
pos I - The column position (1 based).
Returns:
  • The datatype (see sqlo_data_types)
  • SQLO_INVALID_STMT_HANDLE
  • SQLO_INVALID_COLPOS
Since:
Version 2.2

const char* sqlo_get_stmt sqlo_stmt_handle_t  sth  ) 
 

Get the sql statement text for the statement handle.

Parameters:
sth I - A statement handle
Returns:
The sql text.
Since:
Version 2.2

int sqlo_get_stmt_state sqlo_stmt_handle_t  sth  ) 
 

Get the state of the statement.

Note:
Don't use this in Oracle versions < 9.0!
Parameters:
sth I - A statement handle
Returns:
The state (see sqlo_statement_states) or < 0 n error.
Since:
Version 2.2

int sqlo_print sqlo_stmt_handle_t  sth  ) 
 

Print info about the statement to stdout.

Deprecated:
This function will not be enhanced or maintained. This is a kind of debuging code, but better use the builtin trace facility.
Returns:
  • SQLO_SUCCESS
  • < 0 on error
Parameters:
sth A statement handle

int sqlo_register_int_handler int *  handle,
sqlo_signal_handler_t  signal_handler
 

Register a signal handler for interrupts.

Because oracle catches SIGINT, you can register here a handler, which is called by oracle, when SIGINT is catched.

Note:
Don't do any database operation in this handler.
Parameters:
handle O - The created handle. Needed by sqlo_clear_int_handler to clear a signal handler
signal_handler I - The address of the signal handler to register.
Returns:
SQLO_SUCCESS or SQLO_ERROR on error.

int sqlo_server_version sqlo_db_handle_t  dbh,
char *  bufp,
unsigned int  buflen
 

Get the server version string.

Returns the server version string which might look like this:

   Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
   With the Partitioning and Java options
   PL/SQL Release 8.1.5.0.0 - Production.
  
The buffer is null terminated.
Parameters:
dbh I - The database handle
bufp O - The version string
buflen I - Supply her the capacity of your buffer.
Returns:
SQLO_SUCCESS or < 0 on error.
Since:
Version 2.2

int sqlo_set_blocking sqlo_db_handle_t  dbh,
unsigned int  on
 

Set OCI blocking mode on/off.

By default a database connection is in blocking mode. This means the call does not return until the task is finished. With this function you can change to non-blocking mode. In this case some functions can return SQLO_STILL_EXECUTING.

The functions are:

  • sqlo_open2 (when called for queries)
  • sqlo_reopen (when called for queries)
  • sqlo_fetch (when called for non-queries)
  • sqlo_exec
  • sqlo_execute
Parameters:
dbh I - A database handle where the blocking should be changed.
on I - SQLO_ON switches blocking mode on, SQLO_OFF switches to non-blocking mode
Returns:
  • SQLO_SUCCESS
  • SQLO_INVALID_DB_HANDLE
  • < 0 on error
Since:
Version 2.2

int sqlo_set_prefetch_rows sqlo_stmt_handle_t  sth,
unsigned int  nrows
 

Set the prefetch row attribute for a statement.

This functions sets the oci attribute OCI_ATTR_PREFETCH_ROWS to the given value.

Note:
This does not affect the global setting passed by the enviroment variable SQLORA_PREFETCH_ROWS.
Parameters:
sth I - The statement handle
nrows I - The value of the attribute.
Returns:
SQLO_SUCCESS or < 0 on error
Since:
Version 2.2

int sqlo_trace sqlo_db_handle_t  dbh,
int  on
 

Switches Oracle trace on/off.

Use this to switch the Oracle trace facility (tkprof) on or off.

Parameters:
dbh I - A database handle
on I - A flag indicating if we switch tracing on (SQLO_ON) or off (SQLO_OFF)
Returns:
  • SQLO_SUCCESS
  • < 0 on error


Generated on Mon May 21 13:37:50 2007 for libsqlora8 by  doxygen 1.3.9.1