DCL 3.7.4
Loading...
Searching...
No Matches
ODBCParam.h
Go to the documentation of this file.
1#ifndef __DCL_ODBC_PARAM_H__
2#define __DCL_ODBC_PARAM_H__ 20251129
3
4__DCL_BEGIN_NAMESPACE
5
6typedef union __PARAM_BUFFER_MINIMAL {
7 int32_t i32;
8 int64_t i64;
9 uint32_t u32;
10 uint64_t u64;
11 float f32;
12 double f64;
13 DATE_STRUCT date;
14 TIME_STRUCT time;
15 TIMESTAMP_STRUCT timestamp;
16 SQL_INTERVAL_STRUCT interval;
17 SQL_SS_TIME2_STRUCT time2;
18 SQL_SS_TIMESTAMPOFFSET_STRUCT timestampoffset;
19 char maxsize[32];
21
22class InputStream;
23
24class ODBCParam : public SQL::Param, public ODBCData
25{
27protected:
28 _CONST void* __val;
29 size_t __valSize;
30 SQL::DataType __valType;
31 SQL::DataType __outputType;
32
33protected:
34 virtual ODBCQuery* query() const;
35
36public:
37 bool init(SQL::Query* _query, BIND* _bind);
38
39 bool onBeforeExecute();
40 bool onNeedData();
41 bool onAfterExecute();
42
44 virtual ~ODBCParam();
45
46 // Field implementaion
47 virtual const wchar_t* serverDataTypeName() const;
48
49 virtual bool __getDataSize(
50 size_t* _size,
51 bool _maxsize
52 );
53
54 virtual bool __getData(
55 void* _buf, // data, OUT
56 size_t* _size, // sizeof *_buf, IN OUT
57 SQL::DataType _bufType
58 );
59
60 // Param implementaion
61
62 // output parameter support
63 virtual bool __setOutputType(
64 SQL::DataType _sqlType
65 );
66
67 virtual void setNull();
68
69 virtual bool __setData(
70 _CONST void* _val,
71 size_t _size,
72 SQL::DataType _valType,
73 SQL::DataType _sqlType
74 );
75
76 // implementation
77 bool setInteger(const void* _val, size_t _size);
78 bool setUInteger(const void* _val, size_t _size);
79};
80
81__DCL_END_NAMESPACE
82
83#endif // __DCL_ODBC_PARAM_H__
#define _CONST
Definition Config.h:325
__DCL_BEGIN_NAMESPACE union __PARAM_BUFFER_MINIMAL PARAM_BUFFER_MINIMAL
struct __BIND BIND
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:227
virtual bool __getData(void *_buf, size_t *_size, SQL::DataType _bufType)
virtual bool __setData(_CONST void *_val, size_t _size, SQL::DataType _valType, SQL::DataType _sqlType)
virtual bool __getDataSize(size_t *_size, bool _maxsize)
bool setInteger(const void *_val, size_t _size)
virtual ODBCQuery * query() const
Definition ODBCParam.cpp:71
bool setUInteger(const void *_val, size_t _size)
bool onNeedData()
virtual void setNull()
virtual ~ODBCParam()
Definition ODBCParam.cpp:66
bool init(SQL::Query *_query, BIND *_bind)
Definition ODBCParam.cpp:76
virtual const wchar_t * serverDataTypeName() const
virtual bool __setOutputType(SQL::DataType _sqlType)
bool onBeforeExecute()
Definition ODBCParam.cpp:89
bool onAfterExecute()
DataType
Definition SQLCore.h:59
SQL_SS_TIMESTAMPOFFSET_STRUCT timestampoffset
Definition ODBCParam.h:18
SQL_INTERVAL_STRUCT interval
Definition ODBCParam.h:16
SQL_SS_TIME2_STRUCT time2
Definition ODBCParam.h:17
TIMESTAMP_STRUCT timestamp
Definition ODBCParam.h:15