12
12
#include "psqlodbc.h"
13
#include "descriptor.h"
16
16
* BindInfoClass -- stores information about a bound column
18
18
struct BindInfoClass_
20
Int4 buflen; /* size of buffer */
20
SQLLEN buflen; /* size of buffer */
21
21
char *buffer; /* pointer to the buffer */
22
Int4 *used; /* used space in the buffer (for strings
22
SQLLEN *used; /* used space in the buffer (for strings
23
23
* not counting the '\0') */
24
Int2 returntype; /* kind of conversion to be applied when
24
SQLLEN *indicator; /* indicator == used in many cases ? */
25
SQLSMALLINT returntype; /* kind of conversion to be applied when
25
26
* returning (SQL_C_DEFAULT,
26
27
* SQL_C_CHAR... etc) */
27
Int2 precision; /* the precision for numeric or timestamp type */
28
Int2 scale; /* the scale for numeric type */
28
SQLSMALLINT precision; /* the precision for numeric or timestamp type */
29
SQLSMALLINT scale; /* the scale for numeric type */
29
30
/* area for work variables */
30
31
char dummy_data; /* currently not used */
34
35
char *ttlbuf; /* to save the large result */
35
Int4 ttlbuflen; /* the buffer length */
36
Int4 ttlbufused; /* used length of the buffer */
37
Int4 data_left; /* amount of data left to read
36
SQLLEN ttlbuflen; /* the buffer length */
37
SQLLEN ttlbufused; /* used length of the buffer */
38
SQLLEN data_left; /* amount of data left to read
44
45
struct ParameterInfoClass_
50
Int2 precision; /* the precision for numeric or timestamp type */
51
Int2 scale; /* the scale for numeric type */
50
SQLLEN *indicator; /* indicator == used in many cases ? */
52
SQLSMALLINT precision; /* the precision for numeric or timestamp type */
53
SQLSMALLINT scale; /* the scale for numeric type */
52
54
/* area for work variables */
58
Int4 *EXEC_used; /* amount of data */
60
SQLLEN *EXEC_used; /* amount of data */
59
61
char *EXEC_buffer; /* the data */
66
68
struct ParameterImplClass_
73
Int2 precision; /* the precision for numeric or timestamp type */
74
Int2 scale; /* the scale for numeric type */
70
pgNAME paramName; /* this is unavailable even in 8.1 */
71
SQLSMALLINT paramType;
75
SQLSMALLINT decimal_digits;
76
SQLSMALLINT precision; /* the precision for numeric or timestamp type */
77
SQLSMALLINT scale; /* the scale for numeric type */
79
82
GetDataClass fdata;
83
SQLSMALLINT allocated;
81
84
GetDataClass *gdata;
88
SQLSMALLINT allocated;
86
89
PutDataClass *pdata;
92
95
void extend_iparameter_bindings(IPDFields *opts, int num_params);
93
96
void reset_a_parameter_binding(APDFields *opts, int ipar);
94
97
void reset_a_iparameter_binding(IPDFields *opts, int ipar);
98
int CountParameters(const StatementClass *stmt, Int2 *inCount, Int2 *ioCount, Int2 *outputCount);
95
99
void GetDataInfoInitialize(GetDataInfo *gdata);
96
100
void extend_getdata_info(GetDataInfo *gdata, int num_columns, BOOL shrink);
97
101
void reset_a_getdata_info(GetDataInfo *gdata, int icol);
100
104
void extend_putdata_info(PutDataInfo *pdata, int num_params, BOOL shrink);
101
105
void reset_a_putdata_info(PutDataInfo *pdata, int ipar);
102
106
void PDATA_free_params(PutDataInfo *pdata, char option);
107
void SC_param_next(const StatementClass*, int *param_number, ParameterInfoClass **, ParameterImplClass **);
109
RETCODE prepareParameters(StatementClass *stmt);
110
int decideHowToPrepare(StatementClass *stmt, BOOL force);