dbd/db2/dbd_db2.h

1
#undef UNICODE
2
 
3
#include <sqlcli1.h>
4
#include <sqlutil.h>
5
#include <sqlenv.h>
6
#include <dbd/common.h>
7
 
8
#define DBD_DB2_CONNECTION   "DBD.DB2.Connection"
9
#define DBD_DB2_STATEMENT    "DBD.DB2.Statement"
10
 
11
/*
12
 * result set metadata
13
 */
14
 
15
typedef struct _resultset {
16
    SQLSMALLINT name_len;
17
    SQLSMALLINT type;
18
    SQLUINTEGER size;
19
    SQLSMALLINT scale;
20
    SQLCHAR name[32];
21
} resultset_t;
22
 
23
/*
24
 * bind parameters
25
 */
26
typedef struct _bindparams { 
27
    SQLCHAR *buffer;
28
    SQLINTEGER len;
29
    SQLINTEGER buffer_len;
30
} bindparams_t;
31
 
32
/*
33
 * connection object implentation
34
 */
35
typedef struct _connection {
36
    SQLHANDLE env;
37
    SQLHANDLE db2;
38
} connection_t;
39
 
40
/*
41
 * statement object implementation
42
 */
43
typedef struct _statement {
44
    resultset_t * resultset;
45
    bindparams_t * bind;
46
    unsigned char *buffer;
47
    SQLSMALLINT num_result_columns; /* variable for SQLNumResultCols */
48
 
49
    SQLHANDLE stmt;
50
    SQLHANDLE db2;
51
} statement_t;