1/*
2 * PROGRAM: C preprocessor
3 * MODULE: sqlda_pub.h
4 * DESCRIPTION: Public DSQL definitions (included in ibase.h)
5 *
6 * The contents of this file are subject to the Interbase Public
7 * License Version 1.0 (the "License"); you may not use this file
8 * except in compliance with the License. You may obtain a copy
9 * of the License at http://www.Inprise.com/IPL.html
10 *
11 * Software distributed under the License is distributed on an
12 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
13 * or implied. See the License for the specific language governing
14 * rights and limitations under the License.
15 *
16 * The Original Code was created by Inprise Corporation
17 * and its predecessors. Portions created by Inprise Corporation are
18 * Copyright (C) Inprise Corporation.
19 *
20 * All Rights Reserved.
21 * Contributor(s): ______________________________________.
22 */
23
24#ifndef DSQL_SQLDA_PUB_H
25#define DSQL_SQLDA_PUB_H
26
27/* Definitions for DSQL free_statement routine */
28
29#define DSQL_close 1
30#define DSQL_drop 2
31#define DSQL_unprepare 4
32
33/* Declare the extended SQLDA */
34
35typedef struct
36{
37 ISC_SHORT sqltype; /* datatype of field */
38 ISC_SHORT sqlscale; /* scale factor */
39 ISC_SHORT sqlsubtype; /* datatype subtype - currently BLOBs only */
40 ISC_SHORT sqllen; /* length of data area */
41 ISC_SCHAR* sqldata; /* address of data */
42 ISC_SHORT* sqlind; /* address of indicator variable */
43 ISC_SHORT sqlname_length; /* length of sqlname field */
44 ISC_SCHAR sqlname[32]; /* name of field, name length + space for NULL */
45 ISC_SHORT relname_length; /* length of relation name */
46 ISC_SCHAR relname[32]; /* field's relation name + space for NULL */
47 ISC_SHORT ownname_length; /* length of owner name */
48 ISC_SCHAR ownname[32]; /* relation's owner name + space for NULL */
49 ISC_SHORT aliasname_length; /* length of alias name */
50 ISC_SCHAR aliasname[32]; /* relation's alias name + space for NULL */
51} XSQLVAR;
52
53#define SQLDA_VERSION1 1
54
55typedef struct
56{
57 ISC_SHORT version; /* version of this XSQLDA */
58 ISC_SCHAR sqldaid[8]; /* XSQLDA name field */
59 ISC_LONG sqldabc; /* length in bytes of SQLDA */
60 ISC_SHORT sqln; /* number of fields allocated */
61 ISC_SHORT sqld; /* actual number of fields */
62 XSQLVAR sqlvar[1]; /* first field address */
63} XSQLDA;
64
65#define XSQLDA_LENGTH(n) (sizeof (XSQLDA) + (n - 1) * sizeof (XSQLVAR))
66
67#define SQL_TEXT 452
68#define SQL_VARYING 448
69#define SQL_SHORT 500
70#define SQL_LONG 496
71#define SQL_FLOAT 482
72#define SQL_DOUBLE 480
73#define SQL_D_FLOAT 530
74#define SQL_TIMESTAMP 510
75#define SQL_BLOB 520
76#define SQL_ARRAY 540
77#define SQL_QUAD 550
78#define SQL_TYPE_TIME 560
79#define SQL_TYPE_DATE 570
80#define SQL_INT64 580
81#define SQL_BOOLEAN 32764
82#define SQL_NULL 32766
83
84/* Historical alias for pre v6 code */
85#define SQL_DATE SQL_TIMESTAMP
86
87/***************************/
88/* SQL Dialects */
89/***************************/
90
91#define SQL_DIALECT_V5 1 /* meaning is same as DIALECT_xsqlda */
92#define SQL_DIALECT_V6_TRANSITION 2 /* flagging anything that is delimited
93 by double quotes as an error and
94 flagging keyword DATE as an error */
95#define SQL_DIALECT_V6 3 /* supports SQL delimited identifier,
96 SQLDATE/DATE, TIME, TIMESTAMP,
97 CURRENT_DATE, CURRENT_TIME,
98 CURRENT_TIMESTAMP, and 64-bit exact
99 numeric type */
100#define SQL_DIALECT_CURRENT SQL_DIALECT_V6 /* latest IB DIALECT */
101
102#endif /* DSQL_SQLDA_PUB_H */
103
104