Miscellaneous functions


Enumerator

 SQLO_ERROR = -1
 General error code (maps to OCI_ERROR).
 SQLO_INVALID_HANDLE = -2
 Maps to OCI_INVALID_HANDLE.
 SQLO_STILL_EXECUTING = -3123
 Maps to OCI_STILL_EXECUTING.
 SQLO_CONTINUE = -24200
 Maps to OCI_CONTINUE.
 SQLO_SUCCESS_WITH_INFO = 1
 Maps to OCI_SUCCESS_WITH_INFO.
 SQLO_NEED_DATA = 99
 Maps to OCI_NEED_DATA.
 SQLO_NO_DATA = 100
 Maps to OCI_NO_DATA.
 SQLO_INVALID_DB_HANDLE = (SQLO_ERROR_BASE - 1)
 Invalid dbh passed.
 SQLO_ERRMALLOC = (SQLO_ERROR_BASE - 2)
 Cannot allocate memory.
 SQLO_INVALID_STMT_HANDLE = (SQLO_ERROR_BASE - 3)
 Invalid statement handle passed.
 SQLO_STMT_NOT_OPENED = (SQLO_ERROR_BASE - 4)
 Tried to reopen a not opened cursor in sqlo_reopen.
 SQLO_INVALID_STMT_TYPE = (SQLO_ERROR_BASE - 5)
 Tried to parse a PL/SQL block with sqlo_open.
 SQLO_STMT_NOT_PARSED = (SQLO_ERROR_BASE - 6)
 Tried to bind in/out variables for a non-parsed statement.
 SQLO_INVALID_OCI_HANDLE_TYPE = (SQLO_ERROR_BASE - 7)
 Passed a wrong handle type to sqlo_get_oci_handle.
 SQLO_MALFORMED_VERSION_STR = (SQLO_ERROR_BASE - 8)
 Passed an invalid version string to sqlo_version.
 SQLO_WRONG_VERSION = (SQLO_ERROR_BASE - 9)
 The version of the library does not match your request.
 SQLO_INVALID_COLPOS = (SQLO_ERROR_BASE - 10)
 Column position passed to a function is wrong.
 SQLO_INVALID_SQL = (SQLO_ERROR_BASE -11)
 A invalid sql statement was passed to sqlo_open or sqlo_open2.
 SQLO_UNSUPPORTED_DATA_TYPE = (SQLO_ERROR_BASE - 12)
 Try to query a unsupported data type.
 SQLO_ON = 1
 use this to switch someting on
 SQLO_NULL_IND = -1
 NULL indicator.
 SQLO_NOT_NULL_IND = 0
 NOT NULL indicator.
 SQLO_STH_INIT = -1
 You must init the sth with this before the first call of sqlo_open2.
 SQLO_ONE_PIECE = 0
 Piecewise operation code in sqlo_lob_write_buffer.
 SQLO_FIRST_PIECE = 1
 Piecewise operation code in sqlo_lob_write_buffer.
 SQLO_NEXT_PIECE = 2
 Piecewise operation code in sqlo_lob_write_buffer.
 SQLO_LAST_PIECE = 3
 Piecewise operation code in sqlo_lob_write_buffer.
 SQLOT_NUM = 2
 (ORANET TYPE) oracle numeric
 SQLOT_INT = 3
 (ORANET TYPE) integer
 SQLOT_FLT = 4
 (ORANET TYPE) Floating point number
 SQLOT_STR = 5
 zero terminated string
 SQLOT_VNU = 6
 NUM with preceding length byte.
 SQLOT_PDN = 7
 (ORANET TYPE) Packed Decimal Numeric
 SQLOT_LNG = 8
 long
 SQLOT_VCS = 9
 Variable character string.
 SQLOT_NON = 10
 Null/empty PCC Descriptor entry.
 SQLOT_RID = 11
 rowid
 SQLOT_DAT = 12
 date in oracle format
 SQLOT_VBI = 15
 binary in VCS format
 SQLOT_BIN = 23
 binary data(DTYBIN)
 SQLOT_LBI = 24
 long binary
 SQLOT_UIN = 68
 unsigned integer
 SQLOT_SLS = 91
 Display sign leading separate.
 SQLOT_LVC = 94
 Longer longs (char).
 SQLOT_LVB = 95
 Longer long binary.
 SQLOT_AFC = 96
 Ansi fixed char.
 SQLOT_AVC = 97
 Ansi Var char.
 SQLOT_CUR = 102
 cursor type
 SQLOT_RDD = 104
 rowid descriptor
 SQLOT_LAB = 105
 label type
 SQLOT_OSL = 106
 oslabel type
 SQLOT_NTY = 108
 named object type
 SQLOT_REF = 110
 ref type
 SQLOT_CLOB = 112
 character lob
 SQLOT_BLOB = 113
 binary lob
 SQLOT_BFILEE = 114
 binary file lob
 SQLOT_CFILEE = 115
 character file lob
 SQLOT_RSET = 116
 result set type
 SQLOT_NCO = 122
 named collection type (varray or nested table)
 SQLOT_VST = 155
 OCIString type.
 SQLOT_ODT = 156
 OCIDate type.
 SQLOT_DATE = 184
 ANSI Date.
 SQLOT_TIME = 185
 TIME.
 SQLOT_TIME_TZ = 186
 TIME WITH TIME ZONE.
 SQLOT_TIMESTAMP = 187
 TIMESTAMP.
 SQLOT_TIMESTAMP_TZ = 188
 TIMESTAMP WITH TIME ZONE.
 SQLOT_INTERVAL_YM = 189
 INTERVAL YEAR TO MONTH.
 SQLOT_INTERVAL_DS = 190
 INTERVAL DAY TO SECOND.
 SQLOT_TIMESTAMP_LTZ = 232
 TIMESTAMP WITH LOCAL TZ.
 SQLO_STMT_STATE_EXECUTED = 2
 Statement executed.
 SQLO_STMT_STATE_END_OF_FETCH = 3
 Statement end of fetch reached.
 SQLO_OCI_HTYPE_ERROR = 2
 Error handle.
 SQLO_OCI_HTYPE_SVCCTX = 3
 Service context handle.
 SQLO_OCI_HTYPE_SERVER = 4
 Server handle.
 SQLO_OCI_HTYPE_SESSION = 5
 Session handle.
 SQLO_OCI_HTYPE_STMT = 6
 Statement handle.

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.

Enumerator Documentation

SQLO_CONTINUE = -24200

Maps to OCI_CONTINUE.

SQLO_ERRMALLOC = (SQLO_ERROR_BASE - 2)

Cannot allocate memory.

SQLO_ERROR = -1

General error code (maps to OCI_ERROR).

SQLO_FIRST_PIECE = 1

Piecewise operation code in sqlo_lob_write_buffer.

SQLO_INVALID_COLPOS = (SQLO_ERROR_BASE - 10)

Column position passed to a function is wrong.

SQLO_INVALID_DB_HANDLE = (SQLO_ERROR_BASE - 1)

Invalid dbh passed.

SQLO_INVALID_HANDLE = -2

Maps to OCI_INVALID_HANDLE.

SQLO_INVALID_OCI_HANDLE_TYPE = (SQLO_ERROR_BASE - 7)

Passed a wrong handle type to sqlo_get_oci_handle.

SQLO_INVALID_SQL = (SQLO_ERROR_BASE -11)

A invalid sql statement was passed to sqlo_open or sqlo_open2.

SQLO_INVALID_STMT_HANDLE = (SQLO_ERROR_BASE - 3)

Invalid statement handle passed.

SQLO_INVALID_STMT_TYPE = (SQLO_ERROR_BASE - 5)

Tried to parse a PL/SQL block with sqlo_open.

SQLO_LAST_PIECE = 3

Piecewise operation code in sqlo_lob_write_buffer.

Definition at line 208 of file sqlora.h.

SQLO_MALFORMED_VERSION_STR = (SQLO_ERROR_BASE - 8)

Passed an invalid version string to sqlo_version.

SQLO_NEED_DATA = 99

Maps to OCI_NEED_DATA.

SQLO_NEXT_PIECE = 2

Piecewise operation code in sqlo_lob_write_buffer.

SQLO_NO_DATA = 100

Maps to OCI_NO_DATA.

Examples:
ex11.c, ex12.c, ex17.c, ex18.c, and ex19.c.

Definition at line 154 of file sqlora.h.

SQLO_NOT_NULL_IND = 0

NOT NULL indicator.

SQLO_NULL_IND = -1

NULL indicator.

Examples:
ex12.c, and ex15.c.

SQLO_OCI_HTYPE_ERROR = 2

Error handle.

SQLO_OCI_HTYPE_SERVER = 4

Server handle.

SQLO_OCI_HTYPE_SESSION = 5

Session handle.

SQLO_OCI_HTYPE_STMT = 6

Statement handle.

Definition at line 329 of file sqlora.h.

SQLO_OCI_HTYPE_SVCCTX = 3

Service context handle.

SQLO_ON = 1

use this to switch someting on

SQLO_ONE_PIECE = 0

Piecewise operation code in sqlo_lob_write_buffer.

Examples:
ex13.c.

SQLO_STH_INIT = -1

You must init the sth with this before the first call of sqlo_open2.

Examples:
ex15.c, ex16.c, ex17.c, ex18.c, ex19.c, ex5.c, ex6.c, and ex9.c.

SQLO_STILL_EXECUTING = -3123

Maps to OCI_STILL_EXECUTING.

SQLO_STMT_NOT_OPENED = (SQLO_ERROR_BASE - 4)

Tried to reopen a not opened cursor in sqlo_reopen.

SQLO_STMT_NOT_PARSED = (SQLO_ERROR_BASE - 6)

Tried to bind in/out variables for a non-parsed statement.

SQLO_STMT_STATE_END_OF_FETCH = 3

Statement end of fetch reached.

Definition at line 288 of file sqlora.h.

SQLO_STMT_STATE_EXECUTED = 2

Statement executed.

SQLO_SUCCESS_WITH_INFO = 1

Maps to OCI_SUCCESS_WITH_INFO.

SQLO_UNSUPPORTED_DATA_TYPE = (SQLO_ERROR_BASE - 12)

Try to query a unsupported data type.

Definition at line 184 of file sqlora.h.

SQLO_WRONG_VERSION = (SQLO_ERROR_BASE - 9)

The version of the library does not match your request.

SQLOT_AFC = 96

Ansi fixed char.

SQLOT_AVC = 97

Ansi Var char.

SQLOT_BFILEE = 114

binary file lob

SQLOT_BIN = 23

binary data(DTYBIN)

SQLOT_BLOB = 113

binary lob

Examples:
ex14.c, and ex16.c.

SQLOT_CFILEE = 115

character file lob

SQLOT_CLOB = 112

character lob

Examples:
ex13.c, and ex15.c.

SQLOT_CUR = 102

cursor type

SQLOT_DAT = 12

date in oracle format

SQLOT_DATE = 184

ANSI Date.

SQLOT_FLT = 4

(ORANET TYPE) Floating point number

Examples:
ex10.c, ex11.c, ex12.c, ex17.c, ex18.c, and ex9.c.

SQLOT_INT = 3

(ORANET TYPE) integer

Examples:
ex13.c, ex14.c, ex15.c, ex16.c, ex19.c, and ex9.c.

SQLOT_INTERVAL_DS = 190

INTERVAL DAY TO SECOND.

SQLOT_INTERVAL_YM = 189

INTERVAL YEAR TO MONTH.

SQLOT_LAB = 105

label type

SQLOT_LBI = 24

long binary

SQLOT_LNG = 8

long

SQLOT_LVB = 95

Longer long binary.

SQLOT_LVC = 94

Longer longs (char).

SQLOT_NCO = 122

named collection type (varray or nested table)

SQLOT_NON = 10

Null/empty PCC Descriptor entry.

SQLOT_NTY = 108

named object type

SQLOT_NUM = 2

(ORANET TYPE) oracle numeric

SQLOT_ODT = 156

OCIDate type.

SQLOT_OSL = 106

oslabel type

SQLOT_PDN = 7

(ORANET TYPE) Packed Decimal Numeric

SQLOT_RDD = 104

rowid descriptor

SQLOT_REF = 110

ref type

SQLOT_RID = 11

rowid

SQLOT_RSET = 116

result set type

Examples:
ex18.c.

SQLOT_SLS = 91

Display sign leading separate.

SQLOT_STR = 5

zero terminated string

Examples:
ex11.c, ex12.c, ex18.c, ex19.c, and ex9.c.

SQLOT_TIME = 185

TIME.

SQLOT_TIME_TZ = 186

TIME WITH TIME ZONE.

SQLOT_TIMESTAMP = 187

TIMESTAMP.

SQLOT_TIMESTAMP_LTZ = 232

TIMESTAMP WITH LOCAL TZ.

Definition at line 268 of file sqlora.h.

SQLOT_TIMESTAMP_TZ = 188

TIMESTAMP WITH TIME ZONE.

SQLOT_UIN = 68

unsigned integer

SQLOT_VBI = 15

binary in VCS format

SQLOT_VCS = 9

Variable character string.

SQLOT_VNU = 6

NUM with preceding length byte.

SQLOT_VST = 155

OCIString type.


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:

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:43:28 2007 for libsqlora8 by  doxygen 1.4.7