Go to the source code of this file.
Defines | |
#define | SQLORA8_CHECK_VERSION(major, minor, micro) |
A macro used during compile time to check the version This macro is used during the configure process of your program to check for the right version. More... | |
Typedefs | |
typedef int | sqlo_db_handle_t |
A database handle type. | |
typedef int | sqlo_stmt_handle_t |
A statement handle type. | |
typedef void * | sqlo_lob_desc_t |
LOB descriptor type Hides the Oracle type OCILobLocator*. | |
typedef void(* | sqlo_signal_handler_t )(void) |
The type of the signal handler function. | |
Enumerations | |
enum | sqlo_status_codes { SQLO_SUCCESS = 0, SQLO_ERROR = -1, SQLO_INVALID_HANDLE = -2, SQLO_STILL_EXECUTING = -3123, SQLO_CONTINUE = -24200, SQLO_SUCCESS_WITH_INFO = 1, SQLO_NEED_DATA = 99, SQLO_NO_DATA = 100 } |
Constants defining the return codes of the functions. More... | |
enum | sqlo_error_codes { SQLO_ERROR_BASE = -30000, SQLO_INVALID_DB_HANDLE = (SQLO_ERROR_BASE - 1), SQLO_ERRMALLOC = (SQLO_ERROR_BASE - 2), SQLO_INVALID_STMT_HANDLE = (SQLO_ERROR_BASE - 3), SQLO_STMT_NOT_OPENED = (SQLO_ERROR_BASE - 4), SQLO_INVALID_STMT_TYPE = (SQLO_ERROR_BASE - 5), SQLO_STMT_NOT_PARSED = (SQLO_ERROR_BASE - 6), SQLO_INVALID_OCI_HANDLE_TYPE = (SQLO_ERROR_BASE - 7), SQLO_MALFORMED_VERSION_STR = (SQLO_ERROR_BASE - 8), SQLO_WRONG_VERSION = (SQLO_ERROR_BASE - 9), SQLO_INVALID_COLPOS = (SQLO_ERROR_BASE - 10), SQLO_INVALID_SQL = (SQLO_ERROR_BASE -11) } |
Constants defining error codes returned by the library. More... | |
enum | sqlo_constants { SQLO_OFF = 0, SQLO_ON = 1, SQLO_NULL_IND = -1, SQLO_NOT_NULL_IND = 0, SQLO_STH_INIT = -1, SQLO_ONE_PIECE = 0, SQLO_FIRST_PIECE = 1, SQLO_NEXT_PIECE = 2, SQLO_LAST_PIECE = 3 } |
Some constants used to pass to the functions. More... | |
enum | sqlo_data_types { SQLOT_CHR = 1, SQLOT_NUM = 2, SQLOT_INT = 3, SQLOT_FLT = 4, SQLOT_STR = 5, SQLOT_VNU = 6, SQLOT_PDN = 7, SQLOT_LNG = 8, SQLOT_VCS = 9, SQLOT_NON = 10, SQLOT_RID = 11, SQLOT_DAT = 12, SQLOT_VBI = 15, SQLOT_BIN = 23, SQLOT_LBI = 24, SQLOT_UIN = 68, SQLOT_SLS = 91, SQLOT_LVC = 94, SQLOT_LVB = 95, SQLOT_AFC = 96, SQLOT_AVC = 97, SQLOT_CUR = 102, SQLOT_RDD = 104, SQLOT_LAB = 105, SQLOT_OSL = 106, SQLOT_NTY = 108, SQLOT_REF = 110, SQLOT_CLOB = 112, SQLOT_BLOB = 113, SQLOT_BFILEE = 114, SQLOT_CFILEE = 115, SQLOT_RSET = 116, SQLOT_NCO = 122, SQLOT_VST = 155, SQLOT_ODT = 156, SQLOT_DATE = 184, SQLOT_TIME = 185, SQLOT_TIME_TZ = 186, SQLOT_TIMESTAMP = 187, SQLOT_TIMESTAMP_TZ = 188, SQLOT_INTERVAL_YM = 189, SQLOT_INTERVAL_DS = 190, SQLOT_TIMESTAMP_LTZ = 232 } |
The data types for bind variables The oracle constants are copied from $ORACLE_HOME/rdbms/demo/ocidfn.h. More... | |
enum | sqlo_statement_states { SQLO_STMT_STATE_INITIALIZED = 1, SQLO_STMT_STATE_EXECUTED = 2, SQLO_STMT_STATE_END_OF_FETCH = 3 } |
Possible statement states returned by sqlo_get_stmt_state. More... | |
enum | sqlo_oci_handle_types_e { SQLO_OCI_HTYPE_ENV = 1, SQLO_OCI_HTYPE_ERROR = 2, SQLO_OCI_HTYPE_SVCCTX = 3, SQLO_OCI_HTYPE_SERVER = 4, SQLO_OCI_HTYPE_SESSION = 5, SQLO_OCI_HTYPE_STMT = 6 } |
Oracle OCI Handle types used by sqlo_get_oci_handle. More... | |
Functions | |
int | sqlo_init (int threaded_mode, unsigned int max_db, unsigned int max_cursors) |
Init the library. More... | |
int | sqlo_version (const char *version_str) |
Checks if the version is sufficient. More... | |
const char * | sqlo_geterror (sqlo_db_handle_t dbh) |
Return last error string. More... | |
int | sqlo_geterrcode (sqlo_db_handle_t dbh) |
Return the last error code. More... | |
int | sqlo_exists (sqlo_db_handle_t dbh, const char *table, const char *colname, const char *colval, const char *where) |
Tests if a value exists in a table. More... | |
int | sqlo_count (sqlo_db_handle_t dbh, const char *table, const char *colname, const char *colval, const char *where) |
Counts the number of items in the table. More... | |
int | sqlo_run (sqlo_db_handle_t dbh, const char *stmt, int argc, const char **argv) |
Run a simple sql statements with parameters. More... | |
sqlo_stmt_handle_t | sqlo_open (sqlo_db_handle_t dbh, const char *stmt, int argc, const char **argv) |
Open a new cursor. More... | |
int | sqlo_open2 (sqlo_stmt_handle_t *sthp, sqlo_db_handle_t dbh, const char *stmt, int argc, const char **argv) |
Open a new cursor. More... | |
int | sqlo_reopen (sqlo_stmt_handle_t sth, int argc, const char **argv) |
Reopens a already used cursor. More... | |
int | sqlo_fetch (sqlo_stmt_handle_t sth, unsigned int nrows) |
Fetches the data from an open cursor. More... | |
const char ** | sqlo_values (sqlo_stmt_handle_t sth, int *num, int dostrip) |
Get one dataset. More... | |
const unsigned short * | sqlo_value_lens (sqlo_stmt_handle_t sth, int *num) |
Get the length of the returned values. More... | |
const char ** | sqlo_ocol_names (sqlo_stmt_handle_t sth, int *num) |
Get the select list columns. More... | |
const int * | sqlo_ocol_name_lens (sqlo_stmt_handle_t sth, int *num) |
Get the select list columns name lengths. More... | |
int | sqlo_ncols (sqlo_stmt_handle_t sth, int in) |
Get the number of bind/select-list variables. More... | |
const char * | sqlo_command (sqlo_stmt_handle_t sth) |
Return the sql command. More... | |
int | sqlo_close (sqlo_stmt_handle_t sth) |
Close the cursor. More... | |
int | sqlo_exec (sqlo_db_handle_t dbh, const char *stmt) |
Execute a simple sql statement. More... | |
int | sqlo_isopen (sqlo_stmt_handle_t sth) |
Test if a cursor is open. More... | |
int | sqlo_prows (sqlo_stmt_handle_t sth) |
Return the number of processed rows by this statement. More... | |
int | sqlo_connect (sqlo_db_handle_t *dbhp, const char *cstr) |
Connect to a database. More... | |
int | sqlo_finish (sqlo_db_handle_t dbh) |
Finish the session. More... | |
int | sqlo_split_cstring (const char *cstr, char *uid, char *pwd, char *tnsname, unsigned int bufsize) |
Split an Oracle connect string. More... | |
int | sqlo_server_attach (sqlo_db_handle_t *dbhp, const char *tnsname) |
Attach to a database server. More... | |
int | sqlo_session_begin (sqlo_db_handle_t dbh, const char *username, const char *password) |
Begin a session. More... | |
int | sqlo_server_detach (sqlo_db_handle_t dbh) |
Detach from server. More... | |
int | sqlo_server_free (sqlo_db_handle_t dbh) |
Free a server connection This is your emergency exit when a connection to a database gets lost (end of file on communication channel). More... | |
int | sqlo_session_end (sqlo_db_handle_t dbh) |
End a session. More... | |
const char * | sqlo_getdatabase (sqlo_db_handle_t dbh) |
Returns the tnsname. More... | |
int | sqlo_commit (sqlo_db_handle_t dbh) |
Commit. More... | |
int | sqlo_rollback (sqlo_db_handle_t dbh) |
Rollback. More... | |
int | sqlo_prepare (sqlo_db_handle_t dbh, const char *stmt) |
Parse a statement. More... | |
int | sqlo_bind_by_name (sqlo_stmt_handle_t sth, const char *name, int param_type, const void *param_addr, unsigned int param_size, short *ind_addr, int is_array) |
Bind a variable by name. More... | |
int | sqlo_bind_ref_cursor (sqlo_stmt_handle_t sth, const char *cursor_name, int *sth2p) |
Bind a REF CURSOR. More... | |
int | sqlo_bind_by_pos (sqlo_stmt_handle_t sth, int position, int param_type, const void *param_addr, unsigned int param_size, short *ind_addr, int is_array) |
Bind a variable by position. More... | |
int | sqlo_bind_by_pos2 (sqlo_stmt_handle_t sth, int position, int param_type, const void *param_addr, unsigned int param_size, short *ind_addr, unsigned short *rcode_addr, unsigned int skip_size) |
Bind a variable by position. More... | |
int | sqlo_define_by_pos (sqlo_stmt_handle_t sth, int value_pos, int value_type, const void *value_addr, unsigned int value_size, short *ind_addr, short *rlen_addr, int is_array) |
Define a output variable of the select list. More... | |
int | sqlo_define_by_pos2 (sqlo_stmt_handle_t sth, int value_pos, int value_type, const void *value_addr, unsigned int value_size, short *ind_addr, unsigned short *rlen_addr, unsigned short *rcode_addr, unsigned int skip_size) |
Define a output variable of the select list. More... | |
int | sqlo_define_ntable (sqlo_stmt_handle_t sth, unsigned int pos, int *sth2p) |
Define a nested table Please visit the example for details. More... | |
int | sqlo_execute (sqlo_stmt_handle_t sth, unsigned int iterations) |
Execute a statement. More... | |
int | sqlo_alloc_lob_desc (sqlo_db_handle_t dbh, sqlo_lob_desc_t *loblpp) |
Allocate a lob descriptor. More... | |
int | sqlo_free_lob_desc (sqlo_db_handle_t dbh, sqlo_lob_desc_t *loblpp) |
Free a lob descriptor. More... | |
int | sqlo_lob_write_buffer (sqlo_db_handle_t dbh, sqlo_lob_desc_t loblp, unsigned int loblen, void *bufp, unsigned int bufl, unsigned int piece) |
Write lob data from buffer into the lob column. More... | |
int | sqlo_lob_append_buffer (sqlo_db_handle_t dbh, sqlo_lob_desc_t loblp, unsigned int loblen, void *bufp, unsigned int bufl, unsigned int piece) |
Append lob data from buffer to the lob column. More... | |
int | sqlo_lob_write_stream (sqlo_db_handle_t dbh, sqlo_lob_desc_t loblp, unsigned int filelen, FILE *fp) |
Write lob data from a file into the lob column. More... | |
int | sqlo_lob_get_length (sqlo_db_handle_t dbh, sqlo_lob_desc_t loblp, unsigned int *loblenp) |
Get the length of a lob. More... | |
int | sqlo_lob_read_buffer (sqlo_db_handle_t dbh, sqlo_lob_desc_t loblp, unsigned int loblen, void *bufp, unsigned int bufl) |
Read lob data from lob column into a buffer. More... | |
int | sqlo_lob_read_stream (sqlo_db_handle_t dbh, sqlo_lob_desc_t loblp, unsigned int loblen, FILE *fp) |
Read lob data from lob column into a stream. More... | |
int | sqlo_get_oci_handle (int sqloh, void *ocihp, sqlo_oci_handle_types_e type) |
Get the specified OCI handle. More... | |
int | sqlo_get_db_handle (sqlo_stmt_handle_t sth) |
Return the database handle of a statement handle. More... | |
int | sqlo_set_blocking (sqlo_db_handle_t dbh, unsigned int on) |
Set OCI blocking mode on/off. More... | |
int | sqlo_get_blocking (sqlo_db_handle_t dbh, unsigned int *blocking) |
Get OCI blocking mode. More... | |
int | sqlo_break (sqlo_db_handle_t dbh) |
Abort all operations in non-blocking mode. More... | |
int | sqlo_set_prefetch_rows (sqlo_stmt_handle_t sth, unsigned int nrows) |
Set the prefetch row attribute for a statement. More... | |
int | sqlo_server_version (sqlo_db_handle_t dbh, char *bufp, unsigned int buflen) |
Get the server version string. More... | |
int | sqlo_get_stmt_state (sqlo_stmt_handle_t sth) |
Get the state of the statement. More... | |
const char * | sqlo_get_stmt (sqlo_stmt_handle_t sth) |
Get the sql statement text for the statement handle. More... | |
int | sqlo_get_ocol_dtype (sqlo_stmt_handle_t sth, unsigned int pos) |
Get the datatype of a column in the select list. More... | |
int | sqlo_trace (sqlo_db_handle_t dbh, int on) |
Switches Oracle trace on/off. More... | |
int | sqlo_print (sqlo_stmt_handle_t sth) |
Print info about the statement to stdout. More... | |
int | sqlo_register_int_handler (int *handle, sqlo_signal_handler_t signal_handler) |
Register a signal handler for interrupts. More... | |
int | sqlo_clear_int_handler (int handle) |
Clear an interrupt handler. More... | |
Variables | |
const unsigned | sqlo_major_version |
The major version of the library. | |
const unsigned | sqlo_minor_version |
The minor version of the library. | |
const unsigned | sqlo_micro_version |
The micro version of the library. | |
const unsigned | sqlo_interface_age |
The interface age used by libtool. | |
const unsigned | sqlo_binary_age |
The binary age used by libtool. |
This file is part of the libsqlora8 package which can be found at http://www.poitschke.de/libsqlora8/
Definition in file sqlora.h.
|
Value: (LIBSQLORA8_MAJOR_VERSION > (major) || \ (LIBSQLORA8_MAJOR_VERSION == (major) && LIBSQLORA8_MINOR_VERSION > (minor)) || \ (LIBSQLORA8_MAJOR_VERSION == (major) && LIBSQLORA8_MINOR_VERSION == (minor) && \ LIBSQLORA8_MICRO_VERSION >= (micro))) Used in libsqlora8.m4 |