sqlite3odbc.h
Go to the documentation of this file.
1#ifndef _SQLITE3ODBC_H
2#define _SQLITE3ODBC_H
3
27#if defined(_WIN32) || defined(_WIN64)
28#include <windows.h>
29#include <stdio.h>
30#include <io.h>
31#else
32#include <sys/time.h>
33#include <sys/types.h>
34#include <stdio.h>
35#include <unistd.h>
36#include <errno.h>
37#endif
38#include <stdlib.h>
39#if defined(HAVE_LOCALECONV) || defined(_WIN32) || defined(_WIN64)
40#include <locale.h>
41#endif
42#include <stdarg.h>
43#include <stddef.h>
44#include <string.h>
45#include <sql.h>
46#include <sqlext.h>
47#include <time.h>
48
49#include "sqlite3.h"
50#ifdef HAVE_IODBC
51#include <iodbcinst.h>
52#endif
53#if defined(HAVE_UNIXODBC) || defined(_WIN32) || defined(_WIN64)
54#include <odbcinst.h>
55#endif
56
57#ifndef SQL_API
58#define SQL_API
59#endif
60
61#ifndef HAVE_SQLLEN
62#define SQLLEN SQLINTEGER
63#endif
64
65#define SQLLEN_PTR SQLLEN *
66
67#ifndef HAVE_SQLULEN
68#define SQLULEN SQLUINTEGER
69#endif
70
71#ifndef HAVE_SQLROWCOUNT
72#define SQLROWCOUNT SQLUINTEGER
73#endif
74
75#ifndef HAVE_SQLSETPOSIROW
76#define SQLSETPOSIROW SQLUSMALLINT
77#endif
78
79#ifndef HAVE_SQLROWOFFSET
80#define SQLROWOFFSET SQLLEN
81#endif
82
83#ifndef HAVE_SQLROWSETSIZE
84#define SQLROWSETSIZE SQLULEN
85#endif
86
87struct dbc;
88struct stmt;
89
96typedef struct {
97 int magic;
98 int ov3;
99 int pool;
100#if defined(_WIN32) || defined(_WIN64)
101 CRITICAL_SECTION cs;
102#endif
103 struct dbc *dbcs;
104} ENV;
105
112typedef struct dbc {
113 int magic;
115 struct dbc *next;
116 sqlite3 *sqlite;
118 char *dbname;
119 char *dsn;
121 long t0;
123 int *ov3;
124 int ov3val;
127 struct stmt *stmt;
128 int naterr;
129 char sqlstate[6];
130 SQLCHAR logmsg[1024];
140 int oemcp;
141 int jdconv;
142 int ilike;
143 struct stmt *cur_s3stmt;
145 FILE *trace;
146 char *pwd;
147 int pwdLen;
148#ifdef USE_DLOPEN_FOR_GPPS
149 void *instlib;
150 int (*gpps)();
151#endif
152#if defined(_WIN32) || defined(_WIN64)
153 CRITICAL_SECTION cs;
154 DWORD owner;
155 int xcelqrx;
156#endif
158
165typedef struct {
166 char *db;
167 char *table;
168 char *column;
169 int type;
170 int size;
171 int index;
172 int nosign;
173 int scale;
174 int prec;
177 int ispk;
179 char *typename;
180 char *label;
181} COL;
182
189typedef struct {
190 SQLSMALLINT type;
191 SQLINTEGER max;
193 SQLPOINTER valp;
194 int index;
195 int offs;
196} BINDCOL;
197
204typedef struct {
205 int type, stype;
206 int coldef, scale;
210 void *param;
211 void *param0;
212 int inc;
213 int need;
214 int bound;
215 int offs, len;
216 void *parbuf;
217 char strbuf[64];
218 int s3type;
219 int s3size;
220 void *s3val;
221 int s3ival;
222 sqlite_int64 s3lival;
223 double s3dval;
224} BINDPARM;
225
297
298#endif
299
300/*
301 * Local Variables:
302 * mode: c
303 * c-basic-offset: 4
304 * fill-column: 78
305 * tab-width: 8
306 * End:
307 */
#define SQLULEN
Definition sqlite3odbc.h:68
struct stmt STMT
#define SQLLEN
Definition sqlite3odbc.h:62
struct dbc DBC
Internal structure for bound column (SQLBindCol).
SQLINTEGER max
Max.
SQLLEN * lenp
Value return, actual size of value buffer.
SQLPOINTER valp
Value buffer.
int offs
Byte offset for SQLGetData()
SQLSMALLINT type
ODBC type.
int index
Index of column in result.
Internal structure for bound parameter (SQLBindParameter).
double s3dval
SQLite3 float value.
void * param0
Parameter buffer, initial value.
int need
True when SQL_LEN_DATA_AT_EXEC.
int s3type
SQLite3 type.
int len
Offset/length for SQLParamData()/SQLPutData()
void * param
Parameter buffer.
void * parbuf
Buffer for SQL_LEN_DATA_AT_EXEC etc.
int inc
Increment for paramset size > 1.
SQLLEN * lenp0
Actual size of parameter buffer, initial value.
void * s3val
SQLite3 value buffer.
int stype
ODBC and SQL types.
SQLLEN max
Max.
int bound
True when SQLBindParameter() called.
sqlite_int64 s3lival
SQLite3 64bit integer value.
int s3ival
SQLite3 integer value.
SQLLEN * lenp
Actual size of parameter buffer.
int s3size
SQLite3 size.
Internal structure to describe a column in a result set.
char * column
Column name.
char * label
Column label or NULL.
int nosign
Unsigned type.
int notnull
NOT NULL constraint on column.
int ispk
Flag for primary key (> 0)
int prec
Precision of column.
char * table
Table name.
char * db
Database name.
int type
Data type of column.
int isrowid
Flag for ROWID column (> 0)
int scale
Scale of column.
int autoinc
AUTO_INCREMENT column.
int size
Size of column.
int index
Index of column in result.
Driver internal structure for environment (HENV).
Definition sqlite3odbc.h:96
int pool
True for SQL_CP_ONE_PER_DRIVER.
Definition sqlite3odbc.h:99
int ov3
True for SQL_OV_ODBC3.
Definition sqlite3odbc.h:98
int magic
Magic cookie.
Definition sqlite3odbc.h:97
struct dbc * dbcs
Pointer to first DBC.
Driver internal structure for database connection (HDBC).
int busyint
Interrupt busy handler from SQLCancel()
char * pwd
Password or NULL.
int s3stmt_needmeta
True to get meta data in s3stmt_step().
int nowchar
Don't try to use WCHAR.
struct stmt * cur_s3stmt
Current STMT executing sqlite statement.
long t0
Start time for SQLITE busy handler.
int curtype
Default cursor type.
int step_enable
True for sqlite_compile/step/finalize.
int intrans
True when transaction started.
char * dsn
ODBC data source name.
struct stmt * stmt
STMT list of this DBC.
int pwdLen
Length of password.
int * ov3
True for SQL_OV_ODBC3.
int magic
Magic cookie.
FILE * trace
sqlite3_trace() file pointer or NULL
int oemcp
True for Win32 OEM CP translation.
int longnames
Don't shorten column names.
int trans_disable
True for no transaction support.
ENV * env
Pointer to environment.
int dobigint
Force SQL_BIGINT for INTEGER columns.
int fksupport
Foreign keys on or off.
int ilike
True for ILIKE fixup.
int naterr
Native error code.
char sqlstate[6]
SQL state for SQLError()
int version
SQLITE version number.
int autocommit
Auto commit state.
int jdconv
True for julian day conversion.
struct dbc * next
Pointer to next DBC.
char * dbname
SQLITE database name.
int shortnames
Always use short column names.
SQLCHAR logmsg[1024]
Message for SQLError()
int ov3val
True for SQL_OV_ODBC3.
int nocreat
Don't auto create database file.
sqlite3 * sqlite
SQLITE database handle.
int timeout
Lock timeout value.
Driver internal structure representing SQL statement (HSTMT).
SQLUSMALLINT * row_status0
Internal status array.
int * ov3
True for SQL_OV_ODBC3.
SQLUSMALLINT row_status1
Internal status array for 1 row rowsets.
BINDCOL * bindcols
Array of bound columns.
int naterr
Native error code.
SQLULEN * parm_bind_offs
SQL_ATTR_PARAM_BIND_OFFSET_PTR.
int dcols
Number of entries in dyncols.
SQLULEN bind_type
SQL_ATTR_ROW_BIND_TYPE.
BINDCOL bkmrkcol
Bookmark bound column.
int nbindparms
Number bound parameters.
COL * dyncols
Column array, but malloc()ed.
COL * cols
Result column array.
int dobigint
Force SQL_BIGINT for INTEGER columns.
int s3stmt_rownum
Current row number.
SQLCHAR logmsg[1024]
Message for SQLError()
int ncols
Number of result columns.
SQLULEN * row_count
Row count pointer.
SQLULEN paramset_count
Internal for paramset.
SQLUSMALLINT * parm_oper
SQL_ATTR_PARAM_OPERATION_PTR.
int nowchar[2]
Don't try to use WCHAR.
int binlen
Length of blob data.
int longnames
Don't shorten column names.
SQLULEN parm_bind_type
SQL_ATTR_PARAM_BIND_TYPE.
int guessed_types
Flag for drvprepare()/drvexecute()
char * bincell
Cache for blob data.
SQLCHAR cursorname[32]
Cursor name.
int nrows
Number of result rows.
SQLULEN paramset_size
SQL_ATTR_PARAMSET_SIZE.
int bkmrk
True when bookmarks used.
int * jdconv
True for julian day conversion.
SQLULEN * parm_proc
SQL_ATTR_PARAMS_PROCESSED_PTR.
sqlite3_stmt * s3stmt
SQLite statement handle or NULL.
SQLULEN * bind_offs
SQL_ATTR_ROW_BIND_OFFSET_PTR.
SQLULEN retr_data
SQL_ATTR_RETRIEVE_DATA.
SQLULEN max_rows
SQL_ATTR_MAX_ROWS.
HDBC dbc
Pointer to DBC.
BINDPARM * bindparms
Array of bound parameters.
int has_rowid
Flag for ROWID (>= 0 or -1)
SQLUSMALLINT * parm_status
SQL_ATTR_PARAMS_STATUS_PTR.
int one_tbl
Flag for single table (> 0)
int curtype
Cursor type.
int rowprs
Current start row of rowset.
char ** rows
2-dim array, result set
int isselect
int s3stmt_noreset
False when sqlite3_reset() needed.
SQLULEN rowset_size
Size of rowset.
int nparams
Number of parameters in query.
SQLUINTEGER paramset_nrows
Row count for paramset handling.
int nbindcols
Number of entries in bindcols.
SQLCHAR * query
Current query, raw string.
int * oemcp
True for Win32 OEM CP translation.
int rowp
Current result row.
char * bincache
Cache for blob data.
int pdcount
SQLParamData() counter.
SQLUSMALLINT * row_status
Row status pointer.
int has_pk
Flag for primary key (> 0)
char sqlstate[6]
SQL state for SQLError()
struct stmt * next
Linkage for STMT list in DBC.
int * ilike
True for ILIKE fixup.
SQLULEN row_count0
Row count.
void(* rowfree)()
Free function for rows.
SQLINTEGER * bkmrkptr
SQL_ATTR_FETCH_BOOKMARK_PTR.
Internal dynamic string buffer.
Definition blobtoxy.c:1212

Generated on Sun Nov 26 2023 by doxygen.
Contact: chw@ch-werner.de