47#define int_errorcode int errorcode
68#define TRANS_TIMEOUT 30
69#define MAX_ARG_LEN 256
73#define DEFAULT_LONG_SIZE 4096
74#define DBD_ORACLE_MAX_COLUMNS 256
75#define NUMERIC_FIELD_SIZE 32
77#define CHECK_CONN_QUERY "SELECT 1 FROM dual"
79#define ERR_BUF_SIZE 200
224 "LOB", 5, APR_BUCKET_DATA,
366#ifdef OCI_NEW_LENGTH_SEMANTICS
399 static const char *
const delims =
" \r\n\t;|,";
437 switch (
ret->status) {
440 printf(
"ret->status is %d\n",
ret->status);
451 switch (
ret->status) {
456 printf(
"OPEN ERROR %d (alloc svr): %s\n",
ret->status,
ret->buf);
472 switch (
ret->status) {
477 printf(
"OPEN ERROR %d (alloc svc): %s\n",
ret->status,
ret->buf);
497 switch (
ret->status) {
518 switch (
ret->status) {
523 printf(
"OPEN ERROR %d (server attach): %s\n",
ret->status,
ret->buf);
538 switch (
ret->status) {
543 printf(
"OPEN ERROR %d (attr set): %s\n",
ret->status,
ret->buf);
558 switch (
ret->status) {
563 printf(
"OPEN ERROR %d (alloc auth): %s\n",
ret->status,
ret->buf);
578 switch (
ret->status) {
583 printf(
"OPEN ERROR %d (attr username): %s\n",
ret->status,
ret->buf);
598 switch (
ret->status) {
603 printf(
"OPEN ERROR %d (attr password): %s\n",
ret->status,
ret->buf);
618 switch (
ret->status) {
623 printf(
"OPEN ERROR %d (session begin): %s\n",
ret->status,
ret->buf);
638 switch (
ret->status) {
643 printf(
"OPEN ERROR %d (attr session): %s\n",
ret->status,
ret->buf);
659 &
ret->check_conn_stmt) != 0) {
666#ifdef EXPORT_NATIVE_FUNCS
680 if ((
n < 0) || (
n >=
res->statement->nout)) {
718 switch (
sql->status) {
728 printf(
"Execute error %d: %s\n",
sql->status,
sql->buf);
744 switch (
sql->status) {
746 return "OCI_SUCCESS";
748 return "OCI_SUCCESS_WITH_INFO";
750 return "OCI_NEED_DATA";
752 return "OCI_NO_DATA";
754 return "OCI_INVALID_HANDLE";
756 return "OCI_STILL_EXECUTING";
758 return "OCI_CONTINUE";
766 return "internal error: OCIErrorGet failed";
1006 switch (
sql->status) {
1014 printf(
"Describing prepared statement: %s\n",
sql->buf);
1022 switch (
sql->status) {
1037 switch (
sql->status) {
1048 for (
i=0;
i<
stmt->nout; ++
i) {
1053 switch (
stmt->out[
i].type) {
1055 switch (
stmt->out[
i].type) {
1057 stmt->out[
i].sz = 171;
1061 stmt->out[
i].sz *= 4;
1064 stmt->out[
i].sz = 75;
1067 stmt->out[
i].sz *= 2;
1071 stmt->out[
i].sz = 20;
1078 stmt->out[
i].sz = 75;
1082 printf(
"Unsupported data type: %d\n",
stmt->out[
i].type);
1090 stmt->out[
i].buf.sval,
1096 stmt->out[
i].sz =
sql->long_size * 4 + 4;
1100 stmt->out[
i].buf.raw,
1106 stmt->out[
i].sz =
sql->long_size * 2 + 4;
1110 stmt->out[
i].buf.raw,
1127 -1,
stmt->out[
i].type,
1132 switch (
sql->status) {
1153 switch (
trans->status) {
1180 switch (
sql->status) {
1187 printf(
"Execute error %d: %s\n",
sql->status,
sql->buf);
1234 switch (
trans->status) {
1257 switch (
sql->status) {
1264 printf(
"Executing prepared statement: %s\n",
sql->buf);
1277 (*results)->handle =
sql;
1279 (*results)->seek =
seek;
1280 (*results)->rownum =
seek ? 0 : -1;
1281 (*results)->pool =
pool;
1402 *(
unsigned long*)
values[j]);
1540 switch (
trans->status) {
1567 switch (
sql->status) {
1574 printf(
"Execute error %d: %s\n",
sql->status,
sql->buf);
1621 switch (
trans->status) {
1644 switch (
sql->status) {
1651 printf(
"Executing prepared statement: %s\n",
sql->buf);
1664 (*results)->handle =
sql;
1666 (*results)->seek =
seek;
1667 (*results)->rownum =
seek ? 0 : -1;
1668 (*results)->pool =
pool;
1713 switch (
sql->status) {
1723 (*trans)->handle =
sql;
1727 (
dvoid**)&(*trans)->snapshot1,
1738 (
dvoid**)&(*trans)->snapshot2,
1762 switch (
trans->status) {
1824 if ((
n < 0) || (
n >=
row->res->statement->nout) || (
val->ind == -1)) {
1828 switch (
val->type) {
1833 switch (
sql->status) {
1844 printf(
"Finding LOB length: %s\n",
sql->buf);
1864 switch (
sql->status) {
1875 printf(
"Reading LOB character set: %s\n",
sql->buf);
1900 switch (
sql->status) {
1928 return (
const char*)
buf;
1938 if ((
n < 0) || (
n >=
row->res->statement->nout)) {
1942 if(
val->ind == -1) {
1949 if (entry ==
NULL) {
1956 if (entry ==
NULL) {
1959 *(
unsigned char*)
data =
atoi(entry);
1963 if (entry ==
NULL) {
1970 if (entry ==
NULL) {
1973 *(
unsigned short*)
data =
atoi(entry);
1977 if (entry ==
NULL) {
1984 if (entry ==
NULL) {
1987 *(
unsigned int*)
data =
atoi(entry);
1991 if (entry ==
NULL) {
1998 if (entry ==
NULL) {
2001 *(
unsigned long*)
data =
atol(entry);
2005 if (entry ==
NULL) {
2012 if (entry ==
NULL) {
2019 if (entry ==
NULL) {
2022 *(
float*)
data = (
float)
atof(entry);
2026 if (entry ==
NULL) {
2039 if (entry ==
NULL) {
2042 *(
char**)
data = (
char*)entry;
2052 switch (
val->type) {
2057 switch(
sql->status) {
2065 row->pool,
b->bucket_alloc);
2074 if (entry ==
NULL) {
2078 row->pool,
b->bucket_alloc);
2170 return res->statement->nout;
2178 if (
res->nrows >= 0) {
const char apr_size_t len
APR-UTIL Buckets/Bucket Brigades.
#define TXN_NOTICE_ERRORS(t)
#define TXN_DO_ROLLBACK(t)
APR general purpose library routines.
const unsigned char * buf
#define APR_BUCKET_INIT(e)
#define APR_BUCKET_INSERT_AFTER(a, b)
#define APR_BRIGADE_INSERT_TAIL(b, e)
#define APR_BUCKET_BUFF_SIZE
apr_bucket apr_bucket_brigade * a
apr_pool_t apr_dbd_t const char * query
apr_pool_t const char apr_dbd_t const char ** error
struct apr_dbd_prepared_t apr_dbd_prepared_t
apr_pool_t apr_dbd_t const char const char * label
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
struct apr_dbd_t apr_dbd_t
apr_dbd_t int const char * statement
apr_dbd_transaction_t int mode
struct apr_dbd_results_t apr_dbd_results_t
apr_pool_t const char apr_dbd_t ** handle
apr_pool_t apr_dbd_results_t apr_dbd_row_t int rownum
apr_pool_t apr_dbd_t int apr_dbd_prepared_t int nargs
struct apr_dbd_transaction_t apr_dbd_transaction_t
apr_pool_t apr_dbd_results_t apr_dbd_row_t ** row
apr_pool_t const char * params
struct apr_dbd_row_t apr_dbd_row_t
#define APR_DBD_TRANSACTION_COMMIT
@ APR_DBD_TYPE_ZTIMESTAMP
const char apr_hash_t ** values
apr_text_header const char * text
const char int apr_pool_t * pool
const apr_array_header_t * list
apr_seek_where_t apr_off_t * offset
int strncasecmp(const char *a, const char *b, size_t n)
#define apr_pool_create(newpool, parent)
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
const char const char *const * args
static const char *const types[]
static const char *const trans[040]
apr_bucket_alloc_t * list