ibm_db 5.0.2 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/ext/ibm_db.o +0 -0
  3. data/ext/ibm_db.so +0 -0
  4. data/ext/ruby_ibm_db_cli.o +0 -0
  5. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +30 -2
  6. data/lib/clidriver.tar.gz +0 -0
  7. data/lib/clidriver/bin/db2cli +0 -0
  8. data/lib/clidriver/bin/db2diag +0 -0
  9. data/lib/clidriver/bin/db2drdat +0 -0
  10. data/lib/clidriver/bin/db2dsdcfgfill +0 -0
  11. data/lib/clidriver/bin/db2ldcfg +0 -0
  12. data/lib/clidriver/bin/db2lddrg +0 -0
  13. data/lib/clidriver/bin/db2level +0 -0
  14. data/lib/clidriver/bin/db2support +0 -0
  15. data/lib/clidriver/bin/db2trc +0 -0
  16. data/lib/clidriver/bnd/db2ajgrt.bnd +0 -0
  17. data/lib/clidriver/bnd/db2cli.bnd +0 -0
  18. data/lib/clidriver/bnd/db2cli.lst +4 -0
  19. data/lib/clidriver/bnd/db2clipk.bnd +0 -0
  20. data/lib/clidriver/bnd/db2clist.bnd +0 -0
  21. data/lib/clidriver/bnd/db2spcdb.bnd +0 -0
  22. data/lib/clidriver/cfg/DigiCertGlobalRootCA.arm +22 -0
  23. data/lib/clidriver/cfg/db2cli.ini.sample +16 -0
  24. data/lib/clidriver/cfg/db2dsdriver.cfg.sample +50 -0
  25. data/lib/clidriver/cfg/db2dsdriver.xsd +216 -0
  26. data/lib/clidriver/cfgcache/conlic.bin +0 -0
  27. data/lib/clidriver/conv/alt/04370923.cnv +0 -0
  28. data/lib/clidriver/conv/alt/08500923.cnv +0 -0
  29. data/lib/clidriver/conv/alt/08501252.cnv +0 -0
  30. data/lib/clidriver/conv/alt/08600923.cnv +0 -0
  31. data/lib/clidriver/conv/alt/08630923.cnv +0 -0
  32. data/lib/clidriver/conv/alt/09230437.cnv +0 -0
  33. data/lib/clidriver/conv/alt/09230850.cnv +0 -0
  34. data/lib/clidriver/conv/alt/09230860.cnv +0 -0
  35. data/lib/clidriver/conv/alt/09231043.cnv +0 -0
  36. data/lib/clidriver/conv/alt/09231051.cnv +0 -0
  37. data/lib/clidriver/conv/alt/09231114.cnv +0 -0
  38. data/lib/clidriver/conv/alt/09231208.cnv +0 -0
  39. data/lib/clidriver/conv/alt/09231252.cnv +0 -0
  40. data/lib/clidriver/conv/alt/09231275.cnv +0 -0
  41. data/lib/clidriver/conv/alt/09241252.cnv +0 -0
  42. data/lib/clidriver/conv/alt/09370950.cnv +0 -0
  43. data/lib/clidriver/conv/alt/10430923.cnv +0 -0
  44. data/lib/clidriver/conv/alt/10510923.cnv +0 -0
  45. data/lib/clidriver/conv/alt/11140923.cnv +0 -0
  46. data/lib/clidriver/conv/alt/12080923.cnv +0 -0
  47. data/lib/clidriver/conv/alt/12520850.cnv +0 -0
  48. data/lib/clidriver/conv/alt/12520923.cnv +0 -0
  49. data/lib/clidriver/conv/alt/12750923.cnv +0 -0
  50. data/lib/clidriver/conv/alt/1388ucs2.cnv +0 -0
  51. data/lib/clidriver/conv/alt/IBM00850.ucs +0 -0
  52. data/lib/clidriver/conv/alt/IBM00923.ucs +0 -0
  53. data/lib/clidriver/conv/alt/IBM01252.ucs +0 -0
  54. data/lib/clidriver/conv/ms/0930ucs2.cnv +0 -0
  55. data/lib/clidriver/conv/ms/0939ucs2.cnv +0 -0
  56. data/lib/clidriver/conv/ms/0943ucs2.cnv +0 -0
  57. data/lib/clidriver/conv/ms/0954ucs2.cnv +0 -0
  58. data/lib/clidriver/conv/ms/1390ucs2.cnv +0 -0
  59. data/lib/clidriver/conv/ms/1399ucs2.cnv +0 -0
  60. data/lib/clidriver/conv/ms/5039ucs2.cnv +0 -0
  61. data/lib/clidriver/conv/ms/ucs20943.cnv +0 -0
  62. data/lib/clidriver/include/sql.h +3149 -0
  63. data/lib/clidriver/include/sqlca.h +119 -0
  64. data/lib/clidriver/include/sqlcli.h +1042 -0
  65. data/lib/clidriver/include/sqlcli1.h +1963 -0
  66. data/lib/clidriver/include/sqlda.h +303 -0
  67. data/lib/clidriver/include/sqlenv.h +7389 -0
  68. data/lib/clidriver/include/sqlext.h +2189 -0
  69. data/lib/clidriver/include/sqlstate.h +1397 -0
  70. data/lib/clidriver/include/sqlsystm.h +119 -0
  71. data/lib/clidriver/include/sqltypes.h +22 -0
  72. data/lib/clidriver/include/sqlucode.h +22 -0
  73. data/lib/clidriver/include/sqlunx.h +24 -0
  74. data/lib/clidriver/lib/icc/C/icc/icclib/ICCSIG.txt +23 -0
  75. data/lib/clidriver/lib/icc/C/icc/icclib/libicclib084.so +0 -0
  76. data/lib/clidriver/lib/icc/N/icc/icclib/ICCSIG.txt +23 -0
  77. data/lib/clidriver/lib/icc/N/icc/icclib/libicclib085.so +0 -0
  78. data/lib/clidriver/lib/icc/libgsk8cms_64.so +0 -0
  79. data/lib/clidriver/lib/icc/libgsk8dbfl_64.so +0 -0
  80. data/lib/clidriver/lib/icc/libgsk8iccs_64.so +0 -0
  81. data/lib/clidriver/lib/icc/libgsk8kicc_64.so +0 -0
  82. data/lib/clidriver/lib/icc/libgsk8km_64.so +0 -0
  83. data/lib/clidriver/lib/icc/libgsk8ssl_64.so +0 -0
  84. data/lib/clidriver/lib/icc/libgsk8sys_64.so +0 -0
  85. data/lib/clidriver/lib/icc/libgsk8valn_64.so +0 -0
  86. data/lib/clidriver/lib/libDB2xml4c.so +1 -0
  87. data/lib/clidriver/lib/libDB2xml4c.so.58 +1 -0
  88. data/lib/clidriver/lib/libDB2xml4c.so.58.0 +0 -0
  89. data/lib/clidriver/lib/libdb2.so +1 -0
  90. data/lib/clidriver/lib/libdb2.so.1 +0 -0
  91. data/lib/clidriver/lib/libdb2clixml4c.so +1 -0
  92. data/lib/clidriver/lib/libdb2clixml4c.so.1 +0 -0
  93. data/lib/clidriver/license/UNIX/odbc_LI_cs +278 -0
  94. data/lib/clidriver/license/UNIX/odbc_LI_de +364 -0
  95. data/lib/clidriver/license/UNIX/odbc_LI_el +294 -0
  96. data/lib/clidriver/license/UNIX/odbc_LI_en +752 -0
  97. data/lib/clidriver/license/UNIX/odbc_LI_es +338 -0
  98. data/lib/clidriver/license/UNIX/odbc_LI_fr +396 -0
  99. data/lib/clidriver/license/UNIX/odbc_LI_in +270 -0
  100. data/lib/clidriver/license/UNIX/odbc_LI_it +316 -0
  101. data/lib/clidriver/license/UNIX/odbc_LI_ja +246 -0
  102. data/lib/clidriver/license/UNIX/odbc_LI_ko +240 -0
  103. data/lib/clidriver/license/UNIX/odbc_LI_lt +302 -0
  104. data/lib/clidriver/license/UNIX/odbc_LI_pl +292 -0
  105. data/lib/clidriver/license/UNIX/odbc_LI_pt +314 -0
  106. data/lib/clidriver/license/UNIX/odbc_LI_ru +296 -0
  107. data/lib/clidriver/license/UNIX/odbc_LI_sl +278 -0
  108. data/lib/clidriver/license/UNIX/odbc_LI_tr +296 -0
  109. data/lib/clidriver/license/UNIX/odbc_LI_zh +310 -0
  110. data/lib/clidriver/license/UNIX/odbc_LI_zh_TW +310 -0
  111. data/lib/clidriver/license/odbc_REDIST.txt +128 -0
  112. data/lib/clidriver/license/odbc_notices.txt +444 -0
  113. data/lib/clidriver/msg/en_US.iso88591/db2adm.mo +0 -0
  114. data/lib/clidriver/msg/en_US.iso88591/db2admh.mo +0 -0
  115. data/lib/clidriver/msg/en_US.iso88591/db2caem.mo +0 -0
  116. data/lib/clidriver/msg/en_US.iso88591/db2cklog.mo +0 -0
  117. data/lib/clidriver/msg/en_US.iso88591/db2cli.mo +0 -0
  118. data/lib/clidriver/msg/en_US.iso88591/db2clia1.lst +35 -0
  119. data/lib/clidriver/msg/en_US.iso88591/db2clias.lst +21 -0
  120. data/lib/clidriver/msg/en_US.iso88591/db2clih.mo +0 -0
  121. data/lib/clidriver/msg/en_US.iso88591/db2clit.mo +0 -0
  122. data/lib/clidriver/msg/en_US.iso88591/db2clp.mo +0 -0
  123. data/lib/clidriver/msg/en_US.iso88591/db2clp2.mo +0 -0
  124. data/lib/clidriver/msg/en_US.iso88591/db2diag.mo +0 -0
  125. data/lib/clidriver/msg/en_US.iso88591/db2fodc.mo +0 -0
  126. data/lib/clidriver/msg/en_US.iso88591/db2sql.mo +0 -0
  127. data/lib/clidriver/msg/en_US.iso88591/db2sqlh.mo +0 -0
  128. data/lib/clidriver/msg/en_US.iso88591/db2stt.mo +0 -0
  129. data/lib/clidriver/msg/en_US.iso88591/db2supp.mo +0 -0
  130. data/lib/clidriver/security64/plugin/IBM/client/IBMIAMauth.so +0 -0
  131. data/lib/clidriver/security64/plugin/IBM/client/IBMkrb5.so +0 -0
  132. metadata +131 -2
@@ -0,0 +1,3149 @@
1
+ /******************************************************************************
2
+ **
3
+ ** Source File Name: SQL
4
+ **
5
+ ** (C) COPYRIGHT International Business Machines Corp. 1987, 2011
6
+ ** All Rights Reserved
7
+ ** Licensed Materials - Property of IBM
8
+ **
9
+ ** US Government Users Restricted Rights - Use, duplication or
10
+ ** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
11
+ **
12
+ ** Function = Include File defining:
13
+ ** System Constants
14
+ ** National Language Support Information
15
+ ** SQLCA / SQLDA Constants
16
+ ** Interface to BINDER and PRECOMPILER
17
+ ** Error Message Retrieval Interface
18
+ ** Authorization Constants
19
+ **
20
+ ** Operating System: LINUX
21
+ **
22
+ *******************************************************************************/
23
+ #ifndef SQL_H_SQL
24
+ #define SQL_H_SQL
25
+
26
+ #ifdef __cplusplus
27
+ extern "C" {
28
+ #endif
29
+
30
+
31
+ /* Note: _SQLOLDCHAR defaults to 'char'. See sqlsystm.h for details. */
32
+
33
+ #include <stddef.h>
34
+ #include "sqlsystm.h" /* System dependent defines */
35
+
36
+ #ifndef SQLCODE
37
+ #include "sqlca.h" /* Required include file */
38
+ #endif
39
+
40
+
41
+ /* Release Identifier Constants */
42
+
43
+ #define SQL_RELPRE6 0 /* Pre Version 6.1.0.0 */
44
+ #define SQL_REL6100 6010000 /* V6.1.0.0 */
45
+ #define SQL_REL7100 7010000 /* V7.1.0.0 */
46
+ #define SQL_REL7102 7010200 /* V7.1.2.0 */
47
+ #define SQL_REL7200 7020100 /* V7.2.0.0 */
48
+ #define SQL_REL7201 7020200 /* V7.2.1.0 */
49
+ #define SQL_REL7204 7020400 /* V7.2.4.0 */
50
+ #define SQL_REL8100 8010000 /* V8.1.0.0 */
51
+ #define SQL_REL8101 8010100 /* V8.1.1.0 */
52
+ #define SQL_REL8102 8010200 /* V8.1.2.0 */
53
+ #define SQL_REL8103 8010300 /* V8.1.3.0 */
54
+ #define SQL_REL8104 8010400 /* V8.1.4.0 */
55
+ #define SQL_REL8105 8010500 /* V8.1.5.0 */
56
+ #define SQL_REL8106 8010600 /* V8.1.6.0 */
57
+ #define SQL_REL8200 8020000 /* V8.2.0.0 */
58
+ #define SQL_REL8201 8020100 /* V8.2.1.0 */
59
+ #define SQL_REL8202 8020200 /* V8.2.2.0 */
60
+ #define SQL_REL8203 8020300 /* V8.2.3.0 */
61
+ #define SQL_REL8204 8020400 /* V8.2.4.0 */
62
+ #define SQL_REL8205 8020500 /* V8.2.5.0 */
63
+ #define SQL_REL8206 8020600 /* V8.2.6.0 */
64
+ #define SQL_REL8207 8020700 /* V8.2.7.0 */
65
+ #define SQL_REL9000 9000000 /* V9.0.0.0 */
66
+ #define SQL_REL9100 9010000 /* V9.1.0.0 */
67
+ #define SQL_REL9101 9010100 /* V9.1.1.0 */
68
+ #define SQL_REL9102 9010200 /* V9.1.2.0 */
69
+ #define SQL_REL9103 9010300 /* V9.1.3.0 */
70
+ #define SQL_REL9104 9010400 /* V9.1.4.0 */
71
+ #define SQL_REL9105 9010500 /* V9.1.5.0 */
72
+ #define SQL_REL9106 9010600 /* V9.1.6.0 */
73
+ #define SQL_REL9107 9010700 /* V9.1.7.0 */
74
+ #define SQL_REL9108 9010800 /* V9.1.8.0 */
75
+ #define SQL_REL9109 9010900 /* V9.1.9.0 */
76
+ #define SQL_REL9110 9011000 /* V9.1.10.0 */
77
+ #define SQL_REL9500 9050000 /* V9.5.0.0 */
78
+ #define SQL_REL9501 9050100 /* V9.5.1.0 */
79
+ #define SQL_REL9502 9050200 /* V9.5.2.0 */
80
+ #define SQL_REL9503 9050300 /* V9.5.3.0 */
81
+ #define SQL_REL9504 9050400 /* V9.5.4.0 */
82
+ #define SQL_REL9505 9050500 /* V9.5.5.0 */
83
+ #define SQL_REL9506 9050600 /* V9.5.6.0 */
84
+ #define SQL_REL9507 9050700 /* V9.5.7.0 */
85
+ #define SQL_REL9508 9050800 /* V9.5.8.0 */
86
+ #define SQL_REL9509 9050900 /* V9.5.9.0 */
87
+ #define SQL_REL9510 9051000 /* V9.5.10.0 */
88
+ #define SQL_REL9511 9051100 /* V9.5.11.0 */
89
+ #define SQL_REL9700 9070000 /* V9.7.0.0 */
90
+ #define SQL_REL9701 9070100 /* V9.7.0.1 */
91
+ #define SQL_REL9702 9070200 /* V9.7.2.0 */
92
+ #define SQL_REL9703 9070300 /* V9.7.3.0 */
93
+ #define SQL_REL9704 9070400 /* V9.7.4.0 */
94
+ #define SQL_REL9705 9070500 /* V9.7.5.0 */
95
+ #define SQL_REL9706 9070600 /* V9.7.6.0 */
96
+ #define SQL_REL9707 9070700 /* V9.7.7.0 */
97
+ #define SQL_REL9708 9070800 /* V9.7.8.0 */
98
+ #define SQL_REL9711 9071100 /* V9.7.11.0 */
99
+ #define SQL_REL9800 9080000 /* V9.8.0.0 */
100
+ #define SQL_REL9801 9080100 /* V9.8.0.1 */
101
+ #define SQL_REL9802 9080200 /* V9.8.2.0 */
102
+ #define SQL_REL9803 9080300 /* V9.8.3.0 */
103
+ #define SQL_REL9804 9080400 /* V9.8.4.0 */
104
+ #define SQL_REL9805 9080500 /* V9.8.5.0 */
105
+ #define SQL_REL10100 10010000 /* V10.1.0.0 */
106
+ #define SQL_REL10101 10010100 /* V10.1.1.0 */
107
+ #define SQL_REL10102 10010200 /* V10.1.2.0 */
108
+ #define SQL_REL10103 10010300 /* V10.1.3.0 */
109
+ #define SQL_REL10104 10010400 /* V10.1.4.0 */
110
+ #define SQL_REL10105 10010500 /* V10.1.5.0 */
111
+ #define SQL_REL10106 10010600 /* V10.1.6.0 */
112
+ #define SQL_REL10500 10050000 /* V10.5.0.0 */
113
+ #define SQL_REL10501 10050100 /* V10.5.1.0 */
114
+ #define SQL_REL10502 10050200 /* V10.5.2.0 */
115
+ #define SQL_REL10503 10050300 /* V10.5.3.0 */
116
+ #define SQL_REL10504 10050400 /* V10.5.4.0 */
117
+ #define SQL_REL10505 10050500 /* V10.5.5.0 */
118
+ #define SQL_REL10506 10050600 /* V10.5.6.0 */
119
+ #define SQL_REL10507 10050700 /* V10.5.7.0 */
120
+ #define SQL_REL10509 10050900 /* V10.5.9.0 */
121
+ #define SQL_REL10510 10051000 /* V10.5.10.0 */
122
+ #define SQL_REL10600 10060000 /* V10.6.0.0 */
123
+ #define SQL_REL10601 10060100 /* V10.6.1.0 */
124
+ #define SQL_REL10602 10060200 /* V10.6.2.0 */
125
+ #define SQL_REL10603 10060300 /* V10.6.3.0 */
126
+ #define SQL_REL10700 10070000 /* V10.7.0.0 */
127
+ #define SQL_REL10800 10080000 /* V10.8.0.0 */
128
+ #define SQL_REL11100 11010000 /* V11.1.0.0 */
129
+ #define SQL_REL11010101 11010101 /* V11.1.1.1 */
130
+ #define SQL_REL11010202 11010202 /* V11.1.2.2 */
131
+ #define SQL_REL11010303 11010303 /* V11.1.3.3 */
132
+ #define SQL_REL11010404 11010404 /* V11.1.4.4 */
133
+ #define SQL_REL11010900 11010900 /* V11.1.9.0 */
134
+ #define SQL_REL11050000 11050000 /* V11.5.0.0 */
135
+ #define SQL_REL11050100 11050100 /* V11.5.1.0 */
136
+ #define SQL_REL11050200 11050200 /* V11.5.2.0 */
137
+ #define SQL_REL11050300 11050300 /* V11.5.3.0 */
138
+ #define SQL_REL11050400 11050400 /* V11.5.4.0 */
139
+ #define SQL_FUTUREL 99999999 /* Future Release */
140
+
141
+ /* System Constants */
142
+
143
+ #ifndef SQL_RC_OK
144
+ #define SQL_RC_OK 0 /* successful execution */
145
+ #endif
146
+
147
+ #define SQL_KEYPMAX 64 /* Maximum nbr of key parts in Index */
148
+ #define SQL_KEYLMAX 8192 /* Maximum key length */
149
+ #define SQL_KEYLMAX_4KPAGE 1024 /* Maximum key length for 4K page */
150
+ #define SQL_KEYLMAX_8KPAGE 2048 /* Maximum key length for 8K page */
151
+ #define SQL_KEYLMAX_16KPAGE 4096 /* Maximum key length for 16K page */
152
+ #define SQL_KEYLMAX_32KPAGE 8192 /* Maximum key length for 32K page */
153
+ #define SQL_SORTFLDLMT 32677 /* Maximum size of field for sort */
154
+ #define SQL_MAXRECL_4K 4005 /* Maximum record length on a 4K page */
155
+ #define SQL_MAXRECL_8K 8101 /* Maximum record length on a 8K page */
156
+ #define SQL_MAXRECL 32677 /* Maximum record length */
157
+ #define SQL_MAXTABLES 15 /* Maximum nbr of tables in a SELECT */
158
+ #define SQL_MAXVARS_STMT 32767 /* Maximum nbr of Host Vars per stmt */
159
+ #define SQL_MAXCOLS 3000 /* Internal max nbr of columns in a */
160
+ /* table */
161
+ #define SQL_MAXCOLS_EXT 1012 /* External max nbr of columns in a */
162
+ /* table */
163
+ #define SQL_MAXSEL_ITEMS 1012 /* Maximum nbr of items in a SELECT */
164
+ #define SQL_MAXPARMS 90 /* Maximum nbr of parms in a function */
165
+ #define SQL_MAX_STMT_SIZ 2097152 /* Maximum statement size */
166
+
167
+ #define SQL_SMALL_LENGTH 2 /* Size of a SMALLINT */
168
+ #define SQL_MAXSMALLVAL 32767 /* Maximum value of a SMALLINT */
169
+ #define SQL_MINSMALLVAL (-(SQL_MAXSMALLVAL)-1) /* Minimum value of a SMALLINT */
170
+ #define SQL_MINBOOLEANVAL 0 /* Minimum value of a BOOLEAN */
171
+ #define SQL_MAXBOOLEANVAL 1 /* Maximum value of a BOOLEAN */
172
+ #define SQL_INT_LENGTH 4 /* Size of an INTEGER */
173
+ #define SQL_MAXINTVAL 2147483647 /* Maximum value of an INTEGER */
174
+ #define SQL_MININTVAL (-(SQL_MAXINTVAL)-1) /* Minimum value of an INTEGER */
175
+
176
+ #define SQL_BIGINT_LENGTH 8 /* Size of a BIGINT */
177
+ #ifndef SQL_NO_NATIVE_BIGINT_SUPPORT
178
+ #define SQL_MAXBIGINTVAL DB2_CONSTRUCT_BIGINT_CONSTANT(9223372036854775807) /* Maximum value of a BIGINT */
179
+ #define SQL_MINBIGINTVAL (-(SQL_MAXBIGINTVAL)-1) /* Minimum value of a BIGINT */
180
+ #endif
181
+
182
+ #define SQL_FLOAT_LENGTH 8 /* Size of a FLOAT */
183
+ #define SQL_FLOAT4_LENGTH 4 /* Size of a 4-byte FLOAT */
184
+ #define SQL_MAXSFLTPREC 24 /* Maximum prec for small float */
185
+ #define SQL_MINSFLTPREC 1 /* Minimum prec for small float */
186
+ #define SQL_MAXFLOATPREC 53 /* Minimum prec for any float */
187
+ #define SQL_DEFDEC_PRECISION 5 /* Default precision for DECIMAL */
188
+ #define SQL_DEFDEC_SCALE 0 /* Default scale for DECIMAL */
189
+ #define SQL_MAXDECIMAL 31 /* Maximum scale/prec. for DECIMAL */
190
+ #define SQL_DEFCHAR 1 /* Default length for a CHAR */
191
+ #define SQL_DEFWCHAR 1 /* Default length for a GRAPHIC */
192
+ #define SQL_MAXCHAR 255 /* Maximum length of a CHAR */
193
+ #define SQL_MAXGRAPH (SQL_MAXCHAR/2) /* Maximum length of a */
194
+ /* GRAPHIC */
195
+ #define SQL_MAXLSTR 255 /* Maximum length of an LSTRING */
196
+ #define SQL_SHORTVCHAR 254 /* Default length of a short VARCHAR */
197
+ #define SQL_MAXVCHAR (SQL_MAXRECL - 5) /* Maximum length of a */
198
+ /* VARCHAR */
199
+ #define SQL_MAXVGRAPH (SQL_MAXVCHAR/2) /* Maximum length of a */
200
+ /* VARGRAPHIC */
201
+ #define SQL_MAXBLOB 2147483647 /* Max. length of a BLOB host var */
202
+ #define SQL_MAXCLOB 2147483647 /* Max. length of a CLOB host var */
203
+ #define SQL_MAXDBCLOB 1073741823 /* Max. length of an DBCLOB host */
204
+ /* var */
205
+ #define SQL_LOBLOCATOR_LEN 4 /* Length of a LOB locator host var */
206
+ #define SQL_LOBFILE_LEN 267 /* Length of a LOB file host var */
207
+ #define SQL_VCHAROH 4 /* Overhead for VARCHAR in record */
208
+ #define SQL_VARCOL_OH 4 /* Overhead for variable length type */
209
+ /* in record */
210
+ #define SQL_VARKEY_OH 2 /* Overhead for variable keyparts */
211
+ #define SQL_LONGMAX 32700 /* Maximum length of a LONG VARCHAR */
212
+ #define SQL_LONGGRMAX 16350 /* Max. length of a LONG VARGRAPHIC */
213
+ #define SQL_LVCHAROH 24 /* Overhead for LONG VARCHAR in */
214
+ /* record */
215
+ #define SQL_LOBCHAROH 312 /* Overhead for LOB in record */
216
+ #define SQL_BLOB_MAXLEN 2147483647 /* BLOB maximum length, in bytes */
217
+ #define SQL_CLOB_MAXLEN 2147483647 /* CLOB maximum length, in chars */
218
+ #define SQL_DBCLOB_MAXLEN 1073741823 /* maxlen for dbcs lobs */
219
+ #define SQL_MAXBINARY 255 /* Maximum length of a BINARY */
220
+ #define SQL_MAXVARBINARY (SQL_MAXRECL - 5) /* Maximum length of a */
221
+ /* VARBINARY */
222
+ #define SQL_TIME_LENGTH 3 /* Size of a TIME field */
223
+ #define SQL_TIME_STRLEN 8 /* Size of a TIME field output */
224
+ #define SQL_TIME_MINSTRLEN 5 /* Size of a non-USA TIME field */
225
+ /* output without seconds */
226
+ #define SQL_DATE_LENGTH 4 /* Size of a DATE field */
227
+ #define SQL_DATE_STRLEN 10 /* Size of a DATE field output */
228
+ #define SQL_STAMP_DEF_PREC 6 /* Default precision of a TIMESTAMP */
229
+ #define SQL_STAMP_MIN_PREC 0 /* Minimum precision of a TIMESTAMP */
230
+ #define SQL_STAMP_MAX_PREC 12 /* Maximum precision of a TIMESTAMP */
231
+ #define SQL_STAMP_DEF_LENGTH 10 /* Default length of a TIMESTAMP */
232
+ #define SQL_STAMP_MIN_LENGTH 7 /* Minimum length of a TIMESTAMP */
233
+ #define SQL_STAMP_MAX_LENGTH 13 /* Maximum length of a TIMESTAMP */
234
+ #define SQL_STAMP_DEF_STRLEN 26 /* Length of a TIMESTAMP string */
235
+ /* representation with default scale */
236
+ /* (microseconds) */
237
+ #define SQL_STAMP_MIN_STRLEN 19 /* Length of a TIMESTAMP string */
238
+ /* representation with minimum scale */
239
+ /* (seconds) */
240
+ #define SQL_STAMP_MAX_STRLEN 32 /* Length of a TIMESTAMP string */
241
+ /* representation with maximum scale */
242
+ /* (picoseconds) */
243
+ #define SQL_STAMPTZ_DEF_STRLEN 32 /* Length of a TIMESTAMP time zone */
244
+ /* representation with default scale */
245
+ /* (seconds) */
246
+ #define SQL_STAMPTZ_MIN_STRLEN 25 /* Length of a TIMESTAMP Time Zone */
247
+ /* representation with minimum scale */
248
+ /* (picoseconds) */
249
+ #define SQL_STAMPTZ_MAX_STRLEN 38 /* Length of a TIMESTAMP Time zone */
250
+ /* representation with maximum scale */
251
+ /* (picoseconds) */
252
+ #define SQL_STAMPTZ_STRLEN 6 /* Length of a TIMESTAMP Zone string */
253
+ /* +05:30 */
254
+ #define SQL_STAMPTZ_RESERVED_LEN 122 /* Length of a TIMESTAMP Zone */
255
+ /* reserved for future use */
256
+ #define SQL_STAMP_LENGTH SQL_STAMP_DEF_LENGTH
257
+ #define SQL_STAMP_STRLEN SQL_STAMP_DEF_STRLEN
258
+ #define SQL_STAMP_MINSTRLEN SQL_STAMP_MIN_STRLEN
259
+ #define SQL_BOOLEAN_LENGTH 1 /* Size of a BOOLEAN field */
260
+ #define SQL_DATALINK_LENGTH 254 /* Size of a DATALINK field */
261
+ #define SQL_IND_LENGTH 2 /* Size of an indicator value */
262
+
263
+ #define SQL_DECFLOAT16_LENGTH 8 /* Size of a DECFLOAT16 field */
264
+ #define SQL_DECFLOAT34_LENGTH 16 /* Size of a DECFLOAT34 field */
265
+ #define SQL_MAXDECFLOAT 34 /* Maximum precision for DECFLOAT */
266
+
267
+ #define SQL_MAX_PNAME_LENGTH 254 /* Max size of Stored Proc Name */
268
+ #define SQL_MAX_EXT_NAME_LENGTH 254 /* Max size of External Name */
269
+ #define SQL_MAX_COMMENT_LENGTH 254 /* Max size of Comment */
270
+ #define SQL_MAX_IDENT 128 /* Maximum length of Identifer */
271
+ #define SQL_LG_IDENT 18 /* Maximum length of Long Identifer */
272
+ #define SQL_SH_IDENT 8 /* Maximum length of Short Identifer */
273
+ #define SQL_MN_IDENT 1 /* Minimum length of Identifiers */
274
+ #define SQL_MAX_VAR_NAME 255 /* Max size of Host Variable Name */
275
+ #define SQL_MAX_TENANT_ID 300 /* Maximum tenant Identifiers */
276
+
277
+ /* The original 4K define, SQL_PDB_MAP_SIZE, supports old APIs */
278
+ /* The new 32K define, SQL_PDB_MAP_SIZE_32K, is to be used */
279
+ /* with the new APIs (db2GetDistMap) to access the larger */
280
+ /* partition map. */
281
+ #define SQL_PDB_MAP_SIZE_4K 4096 /* Number of partitions in a pre-V97 */
282
+ /* pmap */
283
+ #define SQL_PDB_MAP_SIZE_32K 32768 /* Number of partitions in the new */
284
+ /* pmap */
285
+ #define SQL_PDB_MAP_SIZE SQL_PDB_MAP_SIZE_4K /* Number of partitions */
286
+ /* in a pmap */
287
+ #define SQL_MAX_NUM_PART_KEYS 500 /* Max # of Partition Keys */
288
+ #define SQL_ZONEDDECIMAL_FORMAT 0x20 /* decimal columns for sqlugrpn are */
289
+ /* in zoneddecimal format */
290
+ #define SQL_IMPLIEDDECIMAL_FORMAT 0x10 /* decimal columns for sqlugrpn are */
291
+ /* in implieddecimal format */
292
+ #define SQL_BINARYNUMERICS_FORMAT 0x4 /* numeric columns for sqlugrpn are */
293
+ /* in binary format */
294
+ #define SQL_PACKEDDECIMAL_FORMAT 0x8 /* decimal columns for sqlugrpn are */
295
+ /* in packeddecimal format */
296
+ #define SQL_CHARSTRING_FORMAT 0x0 /* numeric/decimal columns for */
297
+ /* sqlugrpn are in character string */
298
+ /* format */
299
+ #define SQL_KILO_VALUE 1024 /* # of bytes in a kilobyte */
300
+ #define SQL_MEGA_VALUE 1048576 /* # of bytes in a megabyte */
301
+ #define SQL_GIGA_VALUE 1073741824 /* # of bytes in a gigabyte */
302
+
303
+ #define SQLB_MAX_CONTAIN_NAME_SZ 256 /* size of container name for api's */
304
+ /* (includes 1 byte for C NULL */
305
+ /* terminator) */
306
+ /* System types */
307
+ typedef signed short SQL_PDB_NODE_TYPE;/* Datatype of PDB node */
308
+ typedef int SQL_PDB_PORT_TYPE;/* Datatype of PDB port */
309
+ #define SQL_PDB_MAX_NUM_NODE 1000 /* limit for max. # of nodes */
310
+ #define SQL_PDB_MAX_NUM_CA 2 /* limit for max. # of CAs */
311
+ #define SQL_PDB_MAX_NUM_IDLE 3 /* limit for max. # of IDLEs */
312
+ /* information related to logical node name */
313
+ #define SQL_PDB_NODE_NUM_DIGIT 4 /* no. of digits for node number in */
314
+ /* node name */
315
+ #define SQL_PDB_NODE_NAME_LEN 8 /* length of logical node name */
316
+ #define SQL_NODE_NUM_TO_NAME(name_p,node_num) \
317
+ snprintf(name_p, SQL_PDB_NODE_NAME_LEN+1, "NODE%.*d", SQL_PDB_NODE_NUM_DIGIT, node_num)
318
+ typedef signed short SQL_PDB_DBPARTITION_TYPE;/* Datatype of PDB dbpartition */
319
+ #define SQL_PDB_MAX_NUM_DBPARTITION 1000 /* limit for max. # of dbpartitions */
320
+ /* information related to logical partition name */
321
+ #define SQL_PDB_DBPARTITION_NUM_DIGIT 4 /* no. of digits for dbpartiton */
322
+ /* number in dbpartition name */
323
+ #define SQL_PDB_DBPARTITION_NAME_LEN 15 /* length of logical dbpartition */
324
+ /* name */
325
+ #define SQL_DBPARTITION_NUM_TO_NAME(name_p,dbpartition_num) \
326
+ snprintf(name_p, SQL_PDB_DBPARTITION_NAME_LEN+1, "DBPARTITION%.*d", SQL_PDB_DBPARTITION_NUM_DIGIT, dbpartition_num)
327
+ /* Codepages */
328
+ #define SQL_CP_367 367 /* Codepage 367 - EUC single byte */
329
+ #define SQL_CP_420 420 /* CCSID x01A4, (CP420, ST4) */
330
+ #define SQL_CP_424 424 /* CCSID x01A8, (CP424, ST4) */
331
+ #define SQL_CP_425 425 /* CCSID x01A9, (CP420, ST5) */
332
+ #define SQL_CP_437 437 /* Codepage 437 - US, Europe */
333
+ #define SQL_CP_737 737 /* Codepage 737 - WIN Greece */
334
+ #define SQL_CP_806 806 /* Codepage 806 - ISCII, India */
335
+ #define SQL_CP_813 813 /* Codepage 813 - AIX Greece */
336
+ #define SQL_CP_819 819 /* Codepage 819 - ISO 8859-1 */
337
+ #define SQL_CP_850 850 /* Codepage 850 - International PC */
338
+ #define SQL_CP_855 855 /* Codepage 855 - OS2 Cyrillic */
339
+ #define SQL_CP_852 852 /* Codepage 852 - OS2 Latin2 */
340
+ #define SQL_CP_856 856 /* Codepage 856 - Hebrew */
341
+ #define SQL_CP_857 857 /* Codepage 857 - OS2 Turkey */
342
+ #define SQL_CP_860 860 /* Codepage 860 - Portuguese */
343
+ #define SQL_CP_862 862 /* Codepage 862 - OS2 Hebrew */
344
+ #define SQL_CP_863 863 /* Codepage 863 - Canadian-French */
345
+ #define SQL_CP_864 864 /* Codepage 864 - OS2 Arabic */
346
+ #define SQL_CP_865 865 /* Codepage 865 - Norway, Denmark */
347
+ #define SQL_CP_866 866 /* Codepage 866 - Russia */
348
+ #define SQL_CP_867 867 /* Codepage 867 - OS2 Hebrew */
349
+ #define SQL_CP_869 869 /* Codepage 869 - OS2 Greece */
350
+ #define SQL_CP_874 874 /* Codepage 874 - OS2/AIX Thailand */
351
+ #define SQL_CP_878 878 /* Codepage 878 - KOI-8R Russia */
352
+ #define SQL_CP_891 891 /* Codepage 891 - Korean */
353
+ #define SQL_CP_897 897 /* Codepage 897 - Japanese */
354
+ #define SQL_CP_903 903 /* Codepage 903 - Chinese */
355
+ #define SQL_CP_904 904 /* Codepage 904 - Taiwan */
356
+ #define SQL_CP_912 912 /* Codepage 912 - AIX Latin2 */
357
+ #define SQL_CP_915 915 /* Codepage 915 - AIX Cyrillic */
358
+ #define SQL_CP_916 916 /* Codepage 916 - AIX Hebrew */
359
+ #define SQL_CP_920 920 /* Codepage 920 - AIX Turkey */
360
+ #define SQL_CP_921 921 /* Codepage 921 - Latvia, Lithuania */
361
+ #define SQL_CP_922 922 /* Codepage 922 - Estonia */
362
+ #define SQL_CP_923 923 /* Codepage 923 - ISO 8859-15 */
363
+ #define SQL_CP_1004 1004 /* Codepage 1004 - MS-WINDOWS */
364
+ #define SQL_CP_1040 1040 /* Codepage 1040 - Extended Korean */
365
+ #define SQL_CP_1041 1041 /* Codepage 1041 - Extended Japanese */
366
+ #define SQL_CP_1042 1042 /* Codepage 1042 - Extended Chinese */
367
+ #define SQL_CP_1043 1043 /* Codepage 1043 - Extended Taiwan */
368
+ #define SQL_CP_1046 1046 /* Codepage 1046 - AIX Arabic */
369
+ #define SQL_CP_1051 1051 /* Codepage 1051 - HP Roman8 */
370
+ #define SQL_CP_1088 1088 /* Codepage 1088 - Korea Std */
371
+ #define SQL_CP_1089 1089 /* Codepage 1089 - AIX Arabic */
372
+ #define SQL_CP_1114 1114 /* Codepage 1114 - Big-5 & GBK */
373
+ #define SQL_CP_1115 1115 /* Codepage 1115 - China GB */
374
+ #define SQL_CP_1124 1124 /* Codepage 1124 - AIX Ukraine */
375
+ #define SQL_CP_1125 1125 /* Codepage 1125 - OS/2 Ukraine */
376
+ #define SQL_CP_1126 1126 /* Codepage 1126 - Windows Korean Std */
377
+ #define SQL_CP_1129 1129 /* Codepage 1129 - Vietnamese */
378
+ #define SQL_CP_1131 1131 /* Codepage 1131 - OS/2 Belarus */
379
+ #define SQL_CP_1163 1163 /* Codepage 1163 - Vietnamese */
380
+ #define SQL_CP_1167 1167 /* KOI8-RU - Belarus */
381
+ #define SQL_CP_1168 1168 /* KOI8-U - Ukraine */
382
+ #define SQL_CP_1250 1250 /* Codepage 1250 - Windows Latin-2 */
383
+ #define SQL_CP_1251 1251 /* Codepage 1251 - Windows Cyrillic */
384
+ #define SQL_CP_1252 1252 /* Codepage 1252 - Windows Latin-1 */
385
+ #define SQL_CP_1253 1253 /* Codepage 1253 - Windows Greek */
386
+ #define SQL_CP_1254 1254 /* Codepage 1254 - Windows Turkish */
387
+ #define SQL_CP_1255 1255 /* Codepage 1255 - Windows Hebrew */
388
+ #define SQL_CP_1256 1256 /* Codepage 1256 - Windows Arabic */
389
+ #define SQL_CP_1257 1257 /* Codepage 1257 - Windows Baltic */
390
+ #define SQL_CP_1258 1258 /* Codepage 1258 - Windows Vietnamese */
391
+ #define SQL_CP_1275 1275 /* Codepage 1275 - Mac Latin-1 */
392
+ #define SQL_CP_1280 1280 /* Codepage 1280 - Mac Greek */
393
+ #define SQL_CP_1281 1281 /* Codepage 1281 - Mac Turkish */
394
+ #define SQL_CP_1282 1282 /* Codepage 1282 - Mac Latin-2 */
395
+ #define SQL_CP_1283 1283 /* Codepage 1283 - Mac Cyrillic */
396
+ #define SQL_CP_62208 62208 /* CCSID xF300, (CP856, ST4) */
397
+ #define SQL_CP_62209 62209 /* CCSID xF301, (CP862, ST4) */
398
+ #define SQL_CP_62210 62210 /* CCSID xF302, (CP916, ST4) */
399
+ #define SQL_CP_62213 62213 /* CCSID xF305, (CP862, ST5) */
400
+ #define SQL_CP_62220 62220 /* CCSID xF30C, (CP856, ST6) */
401
+ #define SQL_CP_62221 62221 /* CCSID xF30D, (CP862, ST6) */
402
+ #define SQL_CP_62222 62222 /* CCSID xF30E, (CP916, ST6) */
403
+ #define SQL_CP_62223 62223 /* CCSID xF30F, (CP1255, ST6) */
404
+ #define SQL_CP_62225 62225 /* CCSID xF311, (CP864, ST6) */
405
+ #define SQL_CP_62226 62226 /* CCSID xF312, (CP1046, ST6) */
406
+ #define SQL_CP_62227 62227 /* CCSID xF313, (CP1089, ST6) */
407
+ #define SQL_CP_62228 62228 /* CCSID xF314, (CP1256, ST6) */
408
+ #define SQL_CP_62230 62230 /* CCSID xF316, (CP856, ST8) */
409
+ #define SQL_CP_62231 62231 /* CCSID xF317, (CP862, ST8) */
410
+ #define SQL_CP_62232 62232 /* CCSID xF318, (CP916, ST8) */
411
+ #define SQL_CP_62236 62236 /* CCSID xF31C, (CP856, ST10) */
412
+ #define SQL_CP_62238 62238 /* CCSID xF31E, (CP916, ST10) */
413
+ #define SQL_CP_62239 62239 /* CCSID xF31F, (CP1255, ST10) */
414
+ #define SQL_CP_62241 62241 /* CCSID xF321, (CP856, ST11) */
415
+ #define SQL_CP_62242 62242 /* CCSID xF322, (CP862, ST11) */
416
+ #define SQL_CP_62243 62243 /* CCSID xF323, (CP916, ST11) */
417
+ #define SQL_CP_62244 62244 /* CCSID xF324, (CP1255, ST11) */
418
+ #define SQL_CP_UNKNOWN 57344 /* CCSID xE000, (Unknown or */
419
+ /* unsupported) */
420
+ #define SQL_CP_1162 1162 /* CCSID 1162 - Windows Thailand */
421
+ /* (with Euro) */
422
+ #define SQL_CP_5222 5222 /* CCSID 5222 - Windows Korea */
423
+ #define SQL_CP_5346 5346 /* CCSID 5346 - Windows Latin-2 (v2 */
424
+ /* with Euro) */
425
+ #define SQL_CP_5347 5347 /* CCSID 5347 - Windows Cyrillic (v2 */
426
+ /* with Euro) */
427
+ #define SQL_CP_5348 5348 /* CCSID 5348 - Windows Latin-1 (v2 */
428
+ /* with Euro) */
429
+ #define SQL_CP_5349 5349 /* CCSID 5349 - Windows Greece (v2 */
430
+ /* with Euro) */
431
+ #define SQL_CP_5350 5350 /* CCSID 5350 - Windows Turkey (v2 */
432
+ /* with Euro) */
433
+ #define SQL_CP_5351 5351 /* CCSID 5351 - Windows Hebrew ST5 */
434
+ /* (v2 with Euro) */
435
+ #define SQL_CP_5352 5352 /* CCSID 5352 - Windows Arabic ST5 */
436
+ /* (v2 with Euro) */
437
+ #define SQL_CP_5353 5353 /* CCSID 5353 - Windows Baltic (v2 */
438
+ /* with Euro) */
439
+ #define SQL_CP_5354 5354 /* CCSID 5354 - Windows Vietnam (v2 */
440
+ /* with Euro) */
441
+ #define SQL_CP_62215 62215 /* CCSID 62215 - Windows Hebrew ST4 */
442
+ #define SQL_CP_62237 62237 /* CCSID 62237 - Windows Hebrew ST8 */
443
+ #define SQL_CP_895 895 /* CCSID 895 - Japan 7-bit Latin */
444
+ #define SQL_CP_901 901 /* CCSID 901 - Baltic 8-bit (with */
445
+ /* Euro) */
446
+ #define SQL_CP_902 902 /* CCSID 902 - Estonia ISO-8 (with */
447
+ /* Euro) */
448
+ #define SQL_CP_1008 1008 /* CCSID 1008 - Arabic 8-bit ISO */
449
+ /* ASCII */
450
+ #define SQL_CP_1155 1155 /* CCSID 1155 - Turkey Latin-5 (with */
451
+ /* Euro) */
452
+ #define SQL_CP_4909 4909 /* CCSID 4909 - Greece, Latin ISO-8 */
453
+ /* (with Euro) */
454
+ #define SQL_CP_5104 5104 /* CCSID 5104 - Arabic 8-bit ISO */
455
+ /* ASCII (with Euro) */
456
+ #define SQL_CP_9005 9005 /* CCSID 9005 - Greece, Latin ISO */
457
+ /* 8859-7:2003 (with Euro) */
458
+ #define SQL_CP_21427 21427 /* CCSID 21427 - Taiwan IBM Big-5 */
459
+ /* (with 13493 CNS, 566, 6204 UDC, */
460
+ /* Euro) */
461
+ #define SQL_CP_62212 62212 /* CCSID 62212 - CP867 Hebrew ST10 */
462
+ #define SQL_CP_62214 62214 /* CCSID 62214 - CP867 Hebrew ST5 */
463
+ #define SQL_CP_62216 62216 /* CCSID 62216 - CP867 Hebrew ST6 */
464
+ #define SQL_CP_62217 62217 /* CCSID 62217 - CP867 Hebrew ST8 */
465
+ #define SQL_CP_62219 62219 /* CCSID 62219 - CP867 Hebrew ST11 */
466
+ #define SQL_CP_62240 62240 /* CCSID 62240 - CP856 Hebrew ST11 */
467
+
468
+ /* DBCS Codepages */
469
+ #define SQL_CP_926 926 /* Codepage 926 - Korean */
470
+ #define SQL_CP_951 951 /* Codepage 951 - New Korean */
471
+ #define SQL_CP_301 301 /* Codepage 301 - Japanese */
472
+ #define SQL_CP_928 928 /* Codepage 928 - Chinese */
473
+ #define SQL_CP_927 927 /* Codepage 927 - Taiwan */
474
+ #define SQL_CP_941 941 /* Codepage 941 - Japanese */
475
+ #define SQL_CP_947 947 /* Codepage 947 - Taiwan Big-5 */
476
+ #define SQL_CP_971 971 /* Codepage 971 - Korean 5601 */
477
+ #define SQL_CP_1351 1351 /* Codepage 1351 - Japanese */
478
+ #define SQL_CP_1362 1362 /* Codepage 1362 - Korean Windows */
479
+ #define SQL_CP_1374 1374 /* Codepage 1374 - Big-5 extension of */
480
+ /* HKSCS, DBCS portion */
481
+ #define SQL_CP_1380 1380 /* Codepage1380 - China GB */
482
+ #define SQL_CP_1382 1382 /* Codepage1382 - Simp Chinese GB */
483
+ #define SQL_CP_1385 1385 /* Codepage1385 - Simp Chinese GBK */
484
+ #define SQL_CP_1393 1393 /* Codepage 1393 - Japanese */
485
+
486
+ /* Combined Codepages */
487
+ #define SQL_CP_934 934 /* Codepage 891 + 926 - Korean */
488
+ #define SQL_CP_949 949 /* CP 1088 + 951 - Korean Std */
489
+ #define SQL_CP_932 932 /* Codepage 897 + 301 - Japanese */
490
+ #define SQL_CP_936 936 /* Codepage 903 + 928 - Chinese */
491
+ #define SQL_CP_938 938 /* Codepage 904 + 927 - Taiwan */
492
+ #define SQL_CP_944 944 /* Codepage 1040 + 926 - Ext.Korean */
493
+ #define SQL_CP_942 942 /* Codepage 1041 + 301 - Ext.Japanese */
494
+ #define SQL_CP_943 943 /* Codepage 897 + 941 - Ext.Japanese */
495
+ #define SQL_CP_946 946 /* Codepage 1042 + 928 - Ext.Chinese */
496
+ #define SQL_CP_948 948 /* Codepage 1043 + 927 - Ext.Taiwan */
497
+ #define SQL_CP_950 950 /* Codepage 1114 + 947 - Taiwan Big5 */
498
+ #define SQL_CP_954 954 /* Codepage 954 + 13488 - euc Japan */
499
+ #define SQL_CP_964 964 /* Codepage 964 + 13488 - euc Taiwan */
500
+ #define SQL_CP_970 970 /* Codepage 367 + 971 - Korean 5601 */
501
+ #define SQL_CP_1363 1363 /* Codepage 1363 - Korean Windows */
502
+ #define SQL_CP_1375 1375 /* Codepage 1252 + 1374 - Mixed Big-5 */
503
+ /* extension for HKSCS */
504
+ #define SQL_CP_1381 1381 /* Codepage 1115 +1380 - China GB */
505
+ #define SQL_CP_1383 1383 /* Codepage 367 +1382 - Chinese GB */
506
+ #define SQL_CP_1386 1386 /* Codepage 1114 +1385 - Chinese GBK */
507
+ #define SQL_CP_5488 5488 /* Codepage - Chinese GB18030 */
508
+ #define SQL_CP_1392 1392 /* Codepage - Chinese GB18030 */
509
+ #define SQL_CP_1394 1394 /* Codepage - Japanese Shift */
510
+ /* JISX0213 */
511
+ #define SQL_CP_5039 5039 /* Codepage 1041 + 1351 - Japanese */
512
+ #define SQL_CP_8612 8612 /* CCSID x21A4, (CP420, ST5) */
513
+ #define SQL_CP_62218 62218 /* CCSID xF30A, (CP864, ST8) */
514
+ #define SQL_CP_62224 62224 /* CCSID xF310, (CP420, ST6) */
515
+ #define SQL_CP_62233 62233 /* CCSID xF319, (CP420, ST8) */
516
+ #define SQL_CP_62234 62234 /* CCSID xF31A, (CP1255, ST9) */
517
+ #define SQL_CP_62246 62246 /* CCSID xF326, (CP1046, ST8) */
518
+ #define SQL_CP_62247 62247 /* CCSID xF327, (CP1046, ST9) */
519
+ #define SQL_CP_62248 62248 /* CCSID xF328, (CP1046, ST4) */
520
+ #define SQL_CP_62249 62249 /* CCSID xF329, (CP1046, ST2) */
521
+ #define SQL_CP_62250 62250 /* CCSID xF32A, (CP420, ST12) */
522
+
523
+ /* Unicode CCSIDs */
524
+ #define SQL_CP_1200 1200 /* Codepage1200 - UCS-2 (big-endian) */
525
+ #define SQL_CP_1202 1202 /* Codepage1202 - UCS-2 (little */
526
+ /* endian) */
527
+ #define SQL_CP_1204 1204 /* Codepage1204 - UCS-2 (BOM) */
528
+ #define SQL_CP_1208 1208 /* Codepage1208 - UTF-8 */
529
+ #define SQL_CP_1232 1232 /* Codepage1232 - UTF-32 (big-endian) */
530
+ #define SQL_CP_1234 1234 /* Codepage1234 - UTF-32 (little */
531
+ /* endian) */
532
+ #define SQL_CP_UTF32BE SQL_CP_1232 /* Big-endian UTF-32 */
533
+ #define SQL_CP_UTF32LE SQL_CP_1234 /* Little-endian UTF-32 */
534
+ #define SQL_CP_1236 1236 /* Codepage1236 - UTF-32 (BOM) */
535
+ #define SQL_CP_13488 13488 /* Codepg13488 - UCS-2 (Unicode v2, */
536
+ /* big-endian) */
537
+ #define SQL_CP_13490 13490 /* Codepg13490 - UCS-2 (Unicode v2, */
538
+ /* little-endiant) */
539
+ #define SQL_CP_17584 17584 /* Codepg17584 - UCS-2 (Unicode v3, */
540
+ /* big-endian) */
541
+ #define SQL_CP_17586 17586 /* Codepg17586 - UCS-2 (Unicode v3, */
542
+ /* little-endiant) */
543
+ #define SQL_CP_UTF8 SQL_CP_1208 /* UTF-8 */
544
+ #define SQL_CP_UTF16BE SQL_CP_1200 /* Big-endian UTF-16 */
545
+ #define SQL_CP_UTF16LE SQL_CP_1202 /* Little-endian UTF-16 */
546
+
547
+ /* EBCDIC, PCDATA and ECECP CCSIDs */
548
+ #define SQL_CP_37 37 /* CCSID 37 - EBCDIC - Common */
549
+ /* European */
550
+ #define SQL_CP_273 273 /* CCSID 273 - EBCDIC Austria, */
551
+ /* Germany */
552
+ #define SQL_CP_274 274 /* CCSID 274 - EBCDIC Belgium */
553
+ #define SQL_CP_277 277 /* CCSID 277 - EBCDIC Denmark, Norway */
554
+ #define SQL_CP_278 278 /* CCSID 278 - EBCDIC Finland, Sweden */
555
+ #define SQL_CP_280 280 /* CCSID 280 - EBCDIC Italy */
556
+ #define SQL_CP_284 284 /* CCSID 284 - EBCDIC Spain, Latin */
557
+ /* America */
558
+ #define SQL_CP_285 285 /* CCSID 285 - EBCDIC UK */
559
+ #define SQL_CP_290 290 /* CCSID 290 - EBCDIC Japan */
560
+ #define SQL_CP_297 297 /* CCSID 297 - EBCDIC France */
561
+ #define SQL_CP_300 300 /* CCSID 300 - EBCDIC Japan DBCS */
562
+ #define SQL_CP_423 423 /* CCSID 423 - EBCDIC Greece */
563
+ #define SQL_CP_500 500 /* CCSID 500 - EBCDIC Latin-1 */
564
+ #define SQL_CP_803 803 /* CCSID 803 - EBCDIC Hebrew Set-A, */
565
+ /* ST4 */
566
+ #define SQL_CP_833 833 /* CCSID 833 - EBCDIC Korea Extended */
567
+ /* SBCS */
568
+ #define SQL_CP_834 834 /* CCSID 834 - EBCDIC Korea DBCS */
569
+ /* (with 1880 UDC) */
570
+ #define SQL_CP_835 835 /* CCSID 835 - EBCDIC Taiwan DBCS */
571
+ /* (with 6204 UDC) */
572
+ #define SQL_CP_836 836 /* CCSID 836 - EBCDIC China SBCS */
573
+ #define SQL_CP_837 837 /* CCSID 837 - EBCDIC China DBCS */
574
+ /* (with 1880 UDC) */
575
+ #define SQL_CP_838 838 /* CCSID 838 - EBCDIC Thailand */
576
+ /* Extended SBCS */
577
+ #define SQL_CP_870 870 /* CCSID 870 - EBCDIC Latin-2 */
578
+ #define SQL_CP_871 871 /* CCSID 871 - EBCDIC Iceland */
579
+ #define SQL_CP_875 875 /* CCSID 875 - EBCDIC Greece */
580
+ #define SQL_CP_924 924 /* CCSID 924 - EBCDIC Latin-9 */
581
+ #define SQL_CP_930 930 /* CCSID 930 - EBCDIC Japan mix (with */
582
+ /* 4370 UDC, Extended SBCS) */
583
+ #define SQL_CP_933 933 /* CCSID 933 - EBCDIC Korea mix (with */
584
+ /* 1880 UDC, Extended SBCS) */
585
+ #define SQL_CP_935 935 /* CCSID 935 - EBCDIC China mix (with */
586
+ /* 1880 UDC, Extended SBCS) */
587
+ #define SQL_CP_937 937 /* CCSID 937 - EBCDIC Taiwan mix */
588
+ /* (with 6204 UDC, Extended SBCS) */
589
+ #define SQL_CP_939 939 /* CCSID 939 - EBCDIC Japan mix (with */
590
+ /* 4370 UDC, Extended SBCS) */
591
+ #define SQL_CP_1025 1025 /* CCSID 1025 - EBCDIC Cyrillic */
592
+ #define SQL_CP_1026 1026 /* CCSID 1026 - EBCDIC Turkey Latin-5 */
593
+ #define SQL_CP_1027 1027 /* CCSID 1027 - EBCDIC Japan Extended */
594
+ /* SBCS */
595
+ #define SQL_CP_1047 1047 /* CCSID 1047 - EBCDIC Open Systems */
596
+ /* Latin-1 */
597
+ #define SQL_CP_1112 1112 /* CCSID 1112 - EBCDIC Baltic */
598
+ #define SQL_CP_1122 1122 /* CCSID 1122 - EBCDIC Estonia */
599
+ #define SQL_CP_1123 1123 /* CCSID 1123 - EBCDIC Ukraine */
600
+ #define SQL_CP_1130 1130 /* CCSID 1130 - EBCDIC Vietnam */
601
+ #define SQL_CP_1137 1137 /* CCSID 1137 - EBCDIC Devangari */
602
+ /* (Based on Unicode) */
603
+ #define SQL_CP_1153 1153 /* CCSID 1153 - EBCDIC Latin-2 (with */
604
+ /* Euro) */
605
+ #define SQL_CP_1154 1154 /* CCSID 1154 - EBCDIC Cyrillic (with */
606
+ /* Euro) */
607
+ #define SQL_CP_1156 1156 /* CCSID 1156 - EBCDIC Baltic */
608
+ #define SQL_CP_1157 1157 /* CCSID 1157 - EBCDIC Estonia */
609
+ #define SQL_CP_1158 1158 /* CCSID 1158 - EBCDIC Ukraine */
610
+ #define SQL_CP_1159 1159 /* CCSID 1159 - EBCDIC Taiwan */
611
+ /* Extended SBCS (with Euro) */
612
+ #define SQL_CP_1160 1160 /* CCSID 1160 - EBCDIC Thailanf (with */
613
+ /* Euro) */
614
+ #define SQL_CP_1164 1164 /* CCSID 1164 - EBCDIC Vietnam (with */
615
+ /* Euro) */
616
+ #define SQL_CP_1364 1364 /* CCSID 1364 - EBCDIC Korea mix */
617
+ /* (with Full Hangul) */
618
+ #define SQL_CP_1371 1371 /* CCSID 1371 - EBCDIC Taiwan mix */
619
+ /* (with 6204 UDC, Extended SBCS) */
620
+ #define SQL_CP_1388 1388 /* CCSID 1388 - EBCDIC China mix */
621
+ #define SQL_CP_1390 1390 /* CCSID 1390 - EBCDIC Japan mix */
622
+ /* (with 6205 UDC, Extended SBCS, */
623
+ /* Euro) */
624
+ #define SQL_CP_1399 1399 /* CCSID 1399 - EBCDIC Japan max */
625
+ /* (with 6205 UDC, Exnteded SBCS, */
626
+ /* Euro) */
627
+ #define SQL_CP_4369 4369 /* CCSID 4369 - EBCDIC Austria, */
628
+ /* German (DP94) */
629
+ #define SQL_CP_4396 4396 /* CCSID 4396 - EBCDIC Japan DBCS */
630
+ /* (with 1880 UCD) */
631
+ #define SQL_CP_4899 4899 /* CCSID 4899 - EBCDIC Hebrew Set-A, */
632
+ /* ST4 (with Euro, Sheqel) */
633
+ #define SQL_CP_4930 4930 /* CCSID 4930 - EBCDIC Korea DBCS */
634
+ /* (with Full Hangul) */
635
+ #define SQL_CP_4933 4933 /* CCSID 4933 - EBCDIC China DBCS */
636
+ /* (with all GBK) */
637
+ #define SQL_CP_4971 4971 /* CCSID 4971 - EBCDIC Greece (with */
638
+ /* Euro) */
639
+ #define SQL_CP_5026 5026 /* CCSID 5026 - EBCDIC Japan mix */
640
+ /* (with 1880 UDC, Extended SBCS) */
641
+ #define SQL_CP_5035 5035 /* CCSID 5035 - EBCDIC Japan mix */
642
+ /* (with 1880 UDC, Extended SBCS) */
643
+ #define SQL_CP_5123 5123 /* CCSID 5123 - EBCDIC Japan Latin */
644
+ /* (with Extended SBCS, Euro) */
645
+ #define SQL_CP_5474 5474 /* CCSID 5474 - EBCDIC Traditional */
646
+ /* Chinese DBCS extended-Host */
647
+ #define SQL_CP_5475 5475 /* CCSID 5475 - EBCDIC Traditional */
648
+ /* Chinese Mixed extended-Host */
649
+ #define SQL_CP_8482 8482 /* CCSID 8482 - EBCDIC Japan SBCS */
650
+ /* (with Euro) */
651
+ #define SQL_CP_8616 8616 /* CCSID 8616 - EBCDIC Hebrew subset */
652
+ /* ST10 */
653
+ #define SQL_CP_9027 9027 /* CCSID 9027 - EBCDIC Taiwan (with */
654
+ /* 6204 UDC, Euro) */
655
+ #define SQL_CP_12708 12708 /* CCSID 12708 - EBCDIC Arabic ST7 */
656
+ #define SQL_CP_12712 12712 /* CCSID 12712 - EBCDIC Hebrew ST10 */
657
+ /* (with Euro, Sheqel) */
658
+ #define SQL_CP_13121 13121 /* CCSID 13121 - EBCDIC Korea (with */
659
+ /* Extended SBCS) */
660
+ #define SQL_CP_13124 13124 /* CCSID 13124 - EBCDIC China SBCS */
661
+ #define SQL_CP_16684 16684 /* CCSID 16684 - EBCDIC Japan (with */
662
+ /* 6295 UDC, Euro) */
663
+ #define SQL_CP_16804 16804 /* CCSID 16804 - EBCDIC Arabic ST4 */
664
+ /* (with Euro) */
665
+ #define SQL_CP_28709 28709 /* CCSID 28709 - EBCDIC Taiwan SBCS */
666
+ #define SQL_CP_62211 62211 /* CCSID 62211 - EBCDIC Hebrew ST5 */
667
+ #define SQL_CP_62229 62229 /* CCSID 62229 - EBCDIC Hebrew ST8 */
668
+ #define SQL_CP_62235 62235 /* CCSID 62235 - EBCDIC Hebrew ST6 */
669
+ #define SQL_CP_62245 62245 /* CCSID 62245 - EBCDIC Hebrew ST10 */
670
+ #define SQL_CP_62251 62251 /* CCSID 62251 - zOS Arabic/Latin ST6 */
671
+ #define SQL_CP_808 808 /* CCSID 808 - PCDATA Cyrillic */
672
+ /* (Russian with Euro) */
673
+ #define SQL_CP_848 848 /* CCSID 848 - PCDATA Uktaine (with */
674
+ /* Euro) */
675
+ #define SQL_CP_849 849 /* CCSID 849 - PCDATA Belarus (with */
676
+ /* Euro) */
677
+ #define SQL_CP_858 858 /* CCSID 858 - PCDATA Latin-1E (with */
678
+ /* Euro) */
679
+ #define SQL_CP_872 872 /* CCSID 872 - PCDATA Cyrillic (with */
680
+ /* Euro) */
681
+ #define SQL_CP_1161 1161 /* CCSID 1161 - PCDATA Thailand (with */
682
+ /* Euero) */
683
+ #define SQL_CP_1370 1370 /* CCSID 1370 - PCDATA Taiwan mix */
684
+ /* (with Euro) */
685
+ #define SQL_CP_5210 5210 /* CCSID 5210 - PCDATA China SBCS */
686
+ #define SQL_CP_9044 9044 /* CCSID 9044 - PCDATA Latin-2 (with */
687
+ /* Euro) */
688
+ #define SQL_CP_9048 9048 /* CCSID 9048 - PCDATA Hebrew ST5 */
689
+ /* (with Euro, Sheqel) */
690
+ #define SQL_CP_9049 9049 /* CCSID 9049 - PCDATA Turkey Latin-5 */
691
+ /* (with Euro) */
692
+ #define SQL_CP_9061 9061 /* CCSID 9061 - PCDATA Greece (with */
693
+ /* Euro) */
694
+ #define SQL_CP_9238 9238 /* CCSID 9238 - PCDATA Arabic ST5 */
695
+ /* (with Euro) */
696
+ #define SQL_CP_17248 17248 /* CCSID 17248 - PCDATA Arabic ST5 */
697
+ /* (with Euro) */
698
+ #define SQL_CP_1140 1140 /* CCSID 1140 - ECECP Common */
699
+ /* European, US, Canada */
700
+ #define SQL_CP_1141 1141 /* CCSID 1141 - ECECP Austria, */
701
+ /* Germany */
702
+ #define SQL_CP_1142 1142 /* CCSID 1142 - ECECP Denmakr, Norway */
703
+ #define SQL_CP_1143 1143 /* CCSID 1143 - ECECP Finalnd, Sweden */
704
+ #define SQL_CP_1144 1144 /* CCSID 1144 - ECECP Italy */
705
+ #define SQL_CP_1145 1145 /* CCSID 1145 - ECECP Spanish, Latin */
706
+ /* America */
707
+ #define SQL_CP_1146 1146 /* CCSID 1146 - ECECP UK */
708
+ #define SQL_CP_1147 1147 /* CCSID 1147 - ECECP France */
709
+ #define SQL_CP_1148 1148 /* CCSID 1148 - ECECP International 1 */
710
+ #define SQL_CP_1149 1149 /* CCSID 1149 - ECECP Iceland */
711
+ #define SQL_CP_65535 65535 /* CCSID 65535 - Reserved */
712
+
713
+ /* Datastream Types */
714
+ #define SQL_SBC_PC 0 /* Single byte PC */
715
+ #define SQL_JPN_PC 1 /* Japanese-PC */
716
+ #define SQL_CHN_PC 2 /* Chinese-PC */
717
+ #define SQL_KOR_PC 3 /* Korean-PC */
718
+ #define SQL_KSC_PC 4 /* New Korean-PC */
719
+ #define SQL_KR5_PC 5 /* Korean 5601 */
720
+ #define SQL_TWN_PC 6 /* Taiwan Big-5 */
721
+ #define SQL_CGB_PC 7 /* China GB */
722
+ #define SQL_CGBA_PC 8 /* China GB on AIX */
723
+ #define SQL_EUCJP_PC 9 /* Japan euc */
724
+ #define SQL_EUCTW_PC 10 /* Taiwan euc */
725
+ #define SQL_UCS2_PC 11 /* UCS-2 */
726
+ #define SQL_KSC2_PC 12 /* Korean Windows */
727
+ #define SQL_CGBK_PC 13 /* China GBK */
728
+ #define SQL_UTF8_PC 14 /* UTF-8 */
729
+ #define SQL_CGB18030_PC 15 /* China GB18030 */
730
+ #define SQL_HKBIG5_PC 16 /* Hong Kong Big5 HKSCS */
731
+ #define SQL_UNKN_PC 255 /* Unknown */
732
+
733
+ /* OEM codeset & locale lengths */
734
+ #define SQL_CODESET_LEN 17
735
+ #define SQL_LOCALE_LEN 33
736
+
737
+ /* Codeset & locale lengths for sqle_db_territory_info struct */
738
+ #define SQL_CODESET_SIZE 17
739
+ #define SQL_LOCALE_SIZE 33
740
+
741
+ /* SQLCA Constants */
742
+ #ifndef SQL_RC_INVALID_SQLCA
743
+ #endif
744
+
745
+ /* Size of SQLCA */
746
+ #define SQLCA_SIZE sizeof(struct sqlca)
747
+
748
+ /* SQL Error message token delimiter */
749
+ #define SQL_ERRMC_PRES ((_SQLOLDCHAR) 0xFF) /* delimiter for string entry */
750
+
751
+ /* Offset in SQLERRD - Diagnostic information */
752
+ #define SQL_ERRD_RC 0 /* return code */
753
+ #define SQL_ERRD_REAS 1 /* reason code */
754
+ #define SQL_ERRD_CNT 2 /* nbr rows inserted/updated/deleted */
755
+ #define SQL_ERRD_OPT_CARD 2 /* optimizer estimate of # rows */
756
+ #define SQL_ERRD_OPTM 3 /* obsolete -- do not use -- */
757
+ #define SQL_ERRD_OPT_TOTCOST 3 /* optimzer estimate of total cost */
758
+ #define SQL_ERRD_DCNT 4 /* nbr of cascaded deletes/updates */
759
+ #define SQL_ERRD_LINE 4 /* line number for recompile error */
760
+ #define SQL_ERRD_AUTHTYPE 4 /* authentication type returned for */
761
+ /* CONNECT/ATTACH */
762
+ #define SQL_ERRD_DIAG 5 /* diagnostics */
763
+
764
+ /* Indexes in SQLWARN - Warning flags */
765
+ #define SQL_WARN_ANY 0 /* composite - set if any warnings */
766
+ #define SQL_WARN_TRUNC 1 /* string column truncated */
767
+ #define SQL_WARN_NUL 2 /* null values eliminated */
768
+ #define SQL_WARN_MISM 3 /* nbr of columns/host vars mismatch */
769
+ #define SQL_WARN_ALLR 4 /* no WHERE clause in update/delete */
770
+ #define SQL_WARN_ETO 5 /* error is tolerated */
771
+ #define SQL_WARN_DATE 6 /* date has been truncated */
772
+ #define SQL_WARN_SUB 8 /* character conversion substitution */
773
+ #define SQL_WARN_NUL2 9 /* arithmetic error nulls eliminated */
774
+ #define SQL_WARN_SQLCA 10 /* SQLCA conversion error */
775
+
776
+ /* Values for Warning flags in SQLWARN */
777
+ #define SQL_WARNING 'W' /* warning indicator */
778
+ #define SQL_NULL_TRN 'N' /* null terminator truncated warning */
779
+ #define SQL_TRN_APP_LEN 'X' /* truncation warning with */
780
+ /* application context length */
781
+ /* returned in sqlind */
782
+ #define SQL_NO_WARN ' ' /* no warning indicator */
783
+ #define SQL_ETO 'E' /* error has been tolerated */
784
+
785
+ #define SQL_PREPARE_ESTIMATE_WARNING 'P' /* Compiler estimate warning */
786
+ /* indicator */
787
+ #define SQL_ETC_WARNING 'Y' /* Explicit Trusted Connection */
788
+ /* warning */
789
+ /* SQLDA Constants */
790
+
791
+ /* Increment for type with null indicator */
792
+ #define SQL_TYP_NULINC 1
793
+
794
+ /* Variable Types */
795
+ #define SQL_TYP_DATE 384 /* DATE */
796
+ #define SQL_TYP_NDATE (SQL_TYP_DATE+SQL_TYP_NULINC)
797
+
798
+ #define SQL_TYP_TIME 388 /* TIME */
799
+ #define SQL_TYP_NTIME (SQL_TYP_TIME+SQL_TYP_NULINC)
800
+
801
+ #define SQL_TYP_STAMP 392 /* TIMESTAMP */
802
+ #define SQL_TYP_NSTAMP (SQL_TYP_STAMP+SQL_TYP_NULINC)
803
+
804
+ #define SQL_TYP_DATALINK 396 /* DATALINK */
805
+ #define SQL_TYP_NDATALINK (SQL_TYP_DATALINK+SQL_TYP_NULINC)
806
+
807
+ #define SQL_TYP_CGSTR 400 /* C NUL-terminated graphic str */
808
+ #define SQL_TYP_NCGSTR (SQL_TYP_CGSTR+SQL_TYP_NULINC)
809
+
810
+ #define SQL_TYP_BLOB 404 /* BLOB - varying length string */
811
+ #define SQL_TYP_NBLOB (SQL_TYP_BLOB+SQL_TYP_NULINC)
812
+
813
+ #define SQL_TYP_CLOB 408 /* CLOB - varying length string */
814
+ #define SQL_TYP_NCLOB (SQL_TYP_CLOB+SQL_TYP_NULINC)
815
+
816
+ #define SQL_TYP_DBCLOB 412 /* DBCLOB - varying length string */
817
+ #define SQL_TYP_NDBCLOB (SQL_TYP_DBCLOB+SQL_TYP_NULINC)
818
+
819
+ #define SQL_TYP_VARCHAR 448 /* VARCHAR(i) - varying length string */
820
+ /* (2 byte length) */
821
+ #define SQL_TYP_NVARCHAR (SQL_TYP_VARCHAR+SQL_TYP_NULINC)
822
+
823
+ #define SQL_TYP_CHAR 452 /* CHAR(i) - fixed length string */
824
+ #define SQL_TYP_NCHAR (SQL_TYP_CHAR+SQL_TYP_NULINC)
825
+
826
+ #define SQL_TYP_LONG 456 /* LONG VARCHAR - varying length */
827
+ /* string */
828
+ #define SQL_TYP_NLONG (SQL_TYP_LONG+SQL_TYP_NULINC)
829
+
830
+ #define SQL_TYP_CSTR 460 /* varying length string for C (null */
831
+ /* terminated) */
832
+ #define SQL_TYP_NCSTR (SQL_TYP_CSTR+SQL_TYP_NULINC)
833
+
834
+ #define SQL_TYP_VARGRAPH 464 /* VARGRAPHIC(i) - varying length */
835
+ /* graphic string (2 byte length) */
836
+ #define SQL_TYP_NVARGRAPH (SQL_TYP_VARGRAPH+SQL_TYP_NULINC)
837
+
838
+ #define SQL_TYP_GRAPHIC 468 /* GRAPHIC(i) - fixed length graphic */
839
+ /* string */
840
+ #define SQL_TYP_NGRAPHIC (SQL_TYP_GRAPHIC+SQL_TYP_NULINC)
841
+
842
+ #define SQL_TYP_LONGRAPH 472 /* LONG VARGRAPHIC(i) - varying */
843
+ /* length graphic string */
844
+ #define SQL_TYP_NLONGRAPH (SQL_TYP_LONGRAPH+SQL_TYP_NULINC)
845
+
846
+ #define SQL_TYP_LSTR 476 /* varying length string for Pascal */
847
+ /* (1-byte length) */
848
+ #define SQL_TYP_NLSTR (SQL_TYP_LSTR+SQL_TYP_NULINC)
849
+
850
+ #define SQL_TYP_FLOAT 480 /* FLOAT - 4 or 8 byte floating point */
851
+ #define SQL_TYP_NFLOAT (SQL_TYP_FLOAT+SQL_TYP_NULINC)
852
+
853
+ #define SQL_TYP_DECIMAL 484 /* DECIMAL (m,n) */
854
+ #define SQL_TYP_NDECIMAL (SQL_TYP_DECIMAL+SQL_TYP_NULINC)
855
+
856
+ #define SQL_TYP_ZONED 488 /* Zoned Decimal -> DECIMAL (m,n) */
857
+ #define SQL_TYP_NZONED (SQL_TYP_ZONED+SQL_TYP_NULINC)
858
+
859
+ #define SQL_TYP_BIGINT 492 /* BIGINT - 8-byte signed integer */
860
+ #define SQL_TYP_NBIGINT (SQL_TYP_BIGINT+SQL_TYP_NULINC)
861
+
862
+ #define SQL_TYP_INTEGER 496 /* INTEGER - 4-byte signed integer */
863
+ #define SQL_TYP_NINTEGER (SQL_TYP_INTEGER+SQL_TYP_NULINC)
864
+
865
+ #define SQL_TYP_SMALL 500 /* SMALLINT - 2-byte signed integer */
866
+ #define SQL_TYP_NSMALL (SQL_TYP_SMALL+SQL_TYP_NULINC)
867
+
868
+ #define SQL_TYP_NUMERIC 504 /* NUMERIC -> DECIMAL (m,n) */
869
+ #define SQL_TYP_NNUMERIC (SQL_TYP_NUMERIC+SQL_TYP_NULINC)
870
+
871
+ #define SQL_TYP_BLOB_FILE_OBSOLETE 804 /* Obsolete Value */
872
+ #define SQL_TYP_NBLOB_FILE_OBSOLETE (SQL_TYP_BLOB_FILE_OBSOLETE+SQL_TYP_NULINC)
873
+
874
+ #define SQL_TYP_CLOB_FILE_OBSOLETE 808 /* Obsolete Value */
875
+ #define SQL_TYP_NCLOB_FILE_OBSOLETE (SQL_TYP_CLOB_FILE_OBSOLETE+SQL_TYP_NULINC)
876
+
877
+ #define SQL_TYP_DBCLOB_FILE_OBSOLETE 812 /* Obsolete Value */
878
+ #define SQL_TYP_NDBCLOB_FILE_OBSOLETE (SQL_TYP_DBCLOB_FILE_OBSOLETE+SQL_TYP_NULINC)
879
+
880
+ #define SQL_TYP_ARRAY 900 /* User defined array type */
881
+ #define SQL_TYP_NARRAY (SQL_TYP_ARRAY+SQL_TYP_NULINC)
882
+
883
+ #define SQL_TYP_VARBINARY 908 /* Variable Binary */
884
+ #define SQL_TYP_NVARBINARY (SQL_TYP_VARBINARY+SQL_TYP_NULINC)
885
+
886
+ #define SQL_TYP_BINARY 912 /* Fixed Binary */
887
+ #define SQL_TYP_NBINARY (SQL_TYP_BINARY+SQL_TYP_NULINC)
888
+
889
+ #define SQL_TYP_BLOB_FILE 916 /* BLOB File - Binary Large Object */
890
+ /* File */
891
+ #define SQL_TYP_NBLOB_FILE (SQL_TYP_BLOB_FILE+SQL_TYP_NULINC)
892
+
893
+ #define SQL_TYP_CLOB_FILE 920 /* CLOB File - Char Large Object File */
894
+ #define SQL_TYP_NCLOB_FILE (SQL_TYP_CLOB_FILE+SQL_TYP_NULINC)
895
+
896
+ #define SQL_TYP_DBCLOB_FILE 924 /* DBCLOB File - Double Byte Char */
897
+ /* Large Object File */
898
+ #define SQL_TYP_NDBCLOB_FILE (SQL_TYP_DBCLOB_FILE+SQL_TYP_NULINC)
899
+
900
+ #define SQL_TYP_BLOB_LOCATOR 960 /* BLOB locator */
901
+ #define SQL_TYP_NBLOB_LOCATOR (SQL_TYP_BLOB_LOCATOR+SQL_TYP_NULINC)
902
+
903
+ #define SQL_TYP_CLOB_LOCATOR 964 /* CLOB locator */
904
+ #define SQL_TYP_NCLOB_LOCATOR (SQL_TYP_CLOB_LOCATOR+SQL_TYP_NULINC)
905
+
906
+ #define SQL_TYP_DBCLOB_LOCATOR 968 /* DBCLOB locator */
907
+ #define SQL_TYP_NDBCLOB_LOCATOR (SQL_TYP_DBCLOB_LOCATOR+SQL_TYP_NULINC)
908
+
909
+ #define SQL_TYP_XML 988 /* XML */
910
+ #define SQL_TYP_NXML (SQL_TYP_XML+SQL_TYP_NULINC)
911
+
912
+ #define SQL_TYP_DECFLOAT 996 /* Decimal Float (16/34) */
913
+ #define SQL_TYP_NDECFLOAT (SQL_TYP_DECFLOAT+SQL_TYP_NULINC)
914
+
915
+ #define SQL_TYP_BOOLEAN 2436 /* BOOLEAN */
916
+ #define SQL_TYP_NBOOLEAN (SQL_TYP_BOOLEAN+SQL_TYP_NULINC)
917
+
918
+ #define SQL_TYP_ROW 2440 /* User defined row type */
919
+ #define SQL_TYP_NROW (SQL_TYP_ROW+SQL_TYP_NULINC)
920
+
921
+ #define SQL_TYP_CURSOR 2444 /* CURSOR */
922
+ #define SQL_TYP_NCURSOR (SQL_TYP_CURSOR+SQL_TYP_NULINC)
923
+ #define SQL_TYP_STAMP_TZ 2448 /* TIMESTAMP WITH TIME ZONE */
924
+ #define SQL_TYP_NSTAMP_TZ (SQL_TYP_STAMP_TZ +SQL_TYP_NULINC)
925
+
926
+ #define SQL_LOBTOKEN_LEN SQL_LOBLOCATOR_LEN
927
+ #define SQL_TYP_BLOB_TOKEN SQL_TYP_BLOB_LOCATOR
928
+ #define SQL_TYP_NBLOB_TOKEN SQL_TYP_NBLOB_LOCATOR
929
+ #define SQL_TYP_CLOB_TOKEN SQL_TYP_CLOB_LOCATOR
930
+ #define SQL_TYP_NCLOB_TOKEN SQL_TYP_NCLOB_LOCATOR
931
+ #define SQL_TYP_DBCLOB_TOKEN SQL_TYP_DBCLOB_LOCATOR
932
+ #define SQL_TYP_NDBCLOB_TOKEN SQL_TYP_NDBCLOB_LOCATOR
933
+ #define SQL_NCLOB_MAXLEN SQL_DBCLOB_MAXLEN
934
+ #define SQL_LOBHANDLE_LEN SQL_LOBTOKEN_LEN
935
+ #define SQL_TYP_BLOB_HANDLE SQL_TYP_BLOB_TOKEN
936
+ #define SQL_TYP_NBLOB_HANDLE SQL_TYP_NBLOB_TOKEN
937
+ #define SQL_TYP_CLOB_HANDLE SQL_TYP_CLOB_TOKEN
938
+ #define SQL_TYP_NCLOB_HANDLE SQL_TYP_NCLOB_TOKEN
939
+ #define SQL_TYP_DBCLOB_HANDLE SQL_TYP_DBCLOB_TOKEN
940
+ #define SQL_TYP_NDBCLOB_HANDLE SQL_TYP_NDBCLOB_TOKEN
941
+
942
+ /* Values for 30th byte of sqlname */
943
+ #define SQL_SQLNAME_SYSGEN ((char) 0xFF) /* sqlname is system generated */
944
+ #define SQL_SQLNAME_NOT_SYSGEN ((char) 0x00) /* sqlname is directly derived */
945
+ /* from a single column or */
946
+ /* specified in the AS clause */
947
+
948
+ /* Return Codes for sqlabndx, sqlaprep and sqlarbnd */
949
+ #define SQLA_RC_OPT_IGNORED 20 /* The option(s) specified are not */
950
+ /* supported by the target database */
951
+ /* and will be ignored */
952
+ #define SQLA_RC_BINDWARN 25 /* Bind execution succeeded with */
953
+ /* warnings. */
954
+ #define SQLA_RC_PREPWARN 25 /* Precompilation succeeded with */
955
+ /* warnings. */
956
+ #define SQLA_RC_BINDERROR -1 /* Bind execution failed */
957
+ #define SQLA_RC_PREPERROR -1 /* Precompilation failed */
958
+ #define SQLA_RC_BAD_BINDNAME -2 /* Invalid bind file */
959
+ #define SQLA_RC_BAD_DBNAME -3 /* Invalid database */
960
+ #define SQLA_RC_BAD_MSGNAME -5 /* Invalid message file */
961
+ #define SQLA_RC_BAD_FORMAT -6 /* Invalid format */
962
+ #define SQLA_RC_OPEN_ERROR -31 /* Error opening list file */
963
+ #define SQLA_RC_MFILE_OPEN_ERR -35 /* Error opening message file */
964
+ #define SQLA_RC_FILE_NAME_BAD -36 /* Source file name is invalid */
965
+ #define SQLA_RC_BAD_BNDFILE -39 /* Bind file corrupted */
966
+ #define SQLA_RC_LIST_ERROR -40 /* Bind list errors */
967
+ #define SQLA_RC_INTERRUPT -94 /* Interrupt */
968
+ #define SQLA_RC_OSERROR -1086 /* System error */
969
+ #define SQLA_RC_PREP_BIND_BUSY -1392 /* Prep/Bind already in use */
970
+ #define SQLA_RC_OPTION_LEN_BAD -4903 /* Invalid parm. length */
971
+ #define SQLA_RC_OPTION_PTR_BAD -4904 /* Invalid parm. ptr */
972
+ #define SQLA_RC_OPTION_SIZE_BAD -4905 /* Invalid parm. size */
973
+ #define SQLA_RC_OPTION_DATA_BAD -4917 /* Invalid parm. data */
974
+ #define SQLA_RC_OPTION_INVALID -30104 /* Invalid option or option value */
975
+ #define SQLA_RC_SDK_LICENSE -8005 /* No SDK/6000 license */
976
+
977
+ /* Values used for the date/time format parameter of sqlabind() ** OBSOLETE */
978
+ /* ** */
979
+ #define SQL_FMT_DEF "DEF" /* FORMAT = Default for Country Code */
980
+ #define SQL_FMT_USA "USA" /* FORMAT = USA */
981
+ #define SQL_FMT_EUR "EUR" /* FORMAT = EUR */
982
+ #define SQL_FMT_ISO "ISO" /* FORMAT = ISO */
983
+ #define SQL_FMT_JIS "JIS" /* FORMAT = JIS */
984
+ #define SQL_FMT_LOC "LOC" /* FORMAT = LOCAL */
985
+
986
+ /* The size of a date/time format buffer */
987
+ #define SQL_FMT_LENGTH 3
988
+
989
+ /* Structures used system wide */
990
+
991
+ #ifndef SQL_SQLDBCHAR_DEFN
992
+ #define SQL_SQLDBCHAR_DEFN
993
+ typedef unsigned short sqldbchar;
994
+ #endif
995
+
996
+ /******************************************************************************
997
+ ** sqlchar data structure
998
+ ** This structure is used to pass variable length data to the database manager.
999
+ **
1000
+ ** Table: Fields in the SQLCHAR Structure
1001
+ ** ----------------------------------------------------------------------------
1002
+ ** |Field Name |Data Type |Description |
1003
+ ** |---------------------|---------------|------------------------------------|
1004
+ ** |LENGTH |SMALLINT |Length of the character string |
1005
+ ** | | |pointed to by DATA. |
1006
+ ** |---------------------|---------------|------------------------------------|
1007
+ ** |DATA |CHAR(n) |An array of characters of length |
1008
+ ** | | |LENGTH. |
1009
+ ** |---------------------|---------------|------------------------------------|
1010
+ **
1011
+ ** COBOL Structure
1012
+ **
1013
+ ** This is not defined in any header file. The following is an example that
1014
+ ** shows how to define the structure in COBOL:
1015
+ **
1016
+ ** * Replace maxlen with the appropriate value:
1017
+ ** 01 SQLCHAR.
1018
+ ** 49 SQLCHAR-LEN PIC S9(4) COMP-5.
1019
+ ** 49 SQLCHAR-DATA PIC X(maxlen).
1020
+ *******************************************************************************/
1021
+ SQL_STRUCTURE sqlchar /* General-purpose VARCHAR for */
1022
+ /* casting */
1023
+ {
1024
+ short length;
1025
+ _SQLOLDCHAR data[1];
1026
+ };
1027
+
1028
+ /******************************************************************************
1029
+ ** sqlgraphic data structure
1030
+ *******************************************************************************/
1031
+ SQL_STRUCTURE sqlgraphic /* General-purpose VARGRAPHIC for */
1032
+ /* casting */
1033
+ {
1034
+ short length;
1035
+ #ifdef SQL_WCHART_CONVERT
1036
+ wchar_t data[1];
1037
+ #else
1038
+ sqldbchar data[1];
1039
+ #endif
1040
+ };
1041
+
1042
+ /******************************************************************************
1043
+ ** sqllob data structure
1044
+ ** This structure is used to represent a LOB data type in a host
1045
+ ** programming language.
1046
+ **
1047
+ ** Table: Fields in the sqllob structure
1048
+ ** ----------------------------------------------------------------
1049
+ ** |Field name |Data type |Description |
1050
+ ** |--------------|-------------|---------------------------------|
1051
+ ** |length |sqluint32 |Length in bytes of the data |
1052
+ ** | | |parameter. |
1053
+ ** |--------------|-------------|---------------------------------|
1054
+ ** |data |char(1) |Data being passed in. |
1055
+ ** |--------------|-------------|---------------------------------|
1056
+ **
1057
+ *******************************************************************************/
1058
+ SQL_STRUCTURE sqllob /* General-purpose LOB for casting */
1059
+ {
1060
+ sqluint32 length;
1061
+ char data[1];
1062
+ };
1063
+
1064
+ /******************************************************************************
1065
+ ** sqldbclob data structure
1066
+ *******************************************************************************/
1067
+ SQL_STRUCTURE sqldbclob /* General-purpose DBCLOB for casting */
1068
+ {
1069
+ sqluint32 length;
1070
+ #ifdef SQL_WCHART_CONVERT
1071
+ wchar_t data[1];
1072
+ #else
1073
+ sqldbchar data[1];
1074
+ #endif
1075
+ };
1076
+
1077
+ /******************************************************************************
1078
+ ** sqlfile data structure
1079
+ *******************************************************************************/
1080
+ SQL_STRUCTURE sqlfile /* File reference structure for LOBs */
1081
+ {
1082
+ sqluint32 name_length;
1083
+ sqluint32 data_length;
1084
+ sqluint32 file_options;
1085
+ char name[255];
1086
+ };
1087
+
1088
+ SQL_STRUCTURE sqlfile2 /* Extended file reference structure */
1089
+ /* for LOBs */
1090
+ {
1091
+ sqluint32 name_length;
1092
+ sqluint32 data_length;
1093
+ sqluint32 file_options;
1094
+ char name[255];
1095
+ char reserved[5];
1096
+ sqluint64 offset;
1097
+ };
1098
+
1099
+ /* Values used for SQLVAR.SQLLEN with sqlfile structures */
1100
+ #define SQL_SQLFILE_LEN SQL_LOBFILE_LEN /* Length of an sqlfile LOB */
1101
+ /* file host var */
1102
+ #define SQL_SQLFILE2_LEN 280 /* Length of an sqlfile2 LOB file */
1103
+ /* host var */
1104
+
1105
+ /* Values used for file_options in the sqlfile structures */
1106
+ #define SQL_FILE_READ 2 /* Input file to read from */
1107
+ #define SQL_FILE_CREATE 8 /* Output file - new file to be */
1108
+ /* created */
1109
+ #define SQL_FILE_OVERWRITE 16 /* Output file - overwrite existing */
1110
+ /* file or create a new file if it */
1111
+ /* doesn't exist */
1112
+ #define SQL_FILE_APPEND 32 /* Output file - append to an */
1113
+ /* existing file or create a new file */
1114
+ /* if it doesn't exist */
1115
+
1116
+ /* Structure used to store binder options when calling sqlabndr() */
1117
+ /* or sqlabndx(), or to store precompile options when calling */
1118
+ /* sqlaprep(), or to store rebind options when calling sqlarbnd(). */
1119
+
1120
+ #define sqlbindopt sqloptions
1121
+
1122
+ #ifndef SQL_BIND_OPTS
1123
+
1124
+ /******************************************************************************
1125
+ ** sqloptheader data structure
1126
+ ** Table: Fields in the SQLOPTHEADER Structure
1127
+ ** |----------------------------------------------------------------|
1128
+ ** |Field Name|Data Type|Description |
1129
+ ** |----------|---------|-------------------------------------------|
1130
+ ** |ALLOCATED |INTEGER |Number of elements in the option array |
1131
+ ** | | |of the sqlopt structure. |
1132
+ ** |----------|---------|-------------------------------------------|
1133
+ ** |USED |INTEGER |Number of elements in the option array |
1134
+ ** | | |of the sqlopt structure actually used. |
1135
+ ** | | |This is the number of option pairs (TYPE |
1136
+ ** | | |and VAL) supplied. |
1137
+ ** |----------|---------|-------------------------------------------|
1138
+ *******************************************************************************/
1139
+ SQL_STRUCTURE sqloptheader /* Header for sqlopt structure */
1140
+ {
1141
+ sqluint32 allocated; /* Number of options allocated */
1142
+ sqluint32 used; /* Number of options used */
1143
+ };
1144
+
1145
+ /******************************************************************************
1146
+ ** sqloptions data structure
1147
+ ** Table: Fields in the SQLOPTIONS Structure
1148
+ ** |----------------------------------------------------------------|
1149
+ ** |Field Name| Data Type | Description |
1150
+ ** |----------------------------------------------------------------|
1151
+ ** |TYPE | INTEGER | Bind/precompile/rebind option type. |
1152
+ ** |VAL | INTEGER | Bind/precompile/rebind option value. |
1153
+ ** |----------------------------------------------------------------|
1154
+ ** |Note: |
1155
+ ** |The TYPE and VAL fields are repeated for each bind/precompile/ |
1156
+ ** |rebind option specified. |
1157
+ ** |----------------------------------------------------------------|
1158
+ *******************************************************************************/
1159
+ SQL_STRUCTURE sqloptions /* bind/prep/rebind option */
1160
+ {
1161
+ sqluint32 type; /* Type of bind/prep/rebind option */
1162
+ sqluintptr val; /* Value of bind/prep/rebind option */
1163
+ };
1164
+
1165
+ /******************************************************************************
1166
+ ** sqlopt data structure
1167
+ ** This structure is used to pass bind options to the sqlabndx API,
1168
+ ** precompile options to the sqlaprep API, and rebind options to the
1169
+ ** sqlarbnd API.
1170
+
1171
+ ** Table: Fields in the SQLOPT Structure
1172
+ ** |----------------------------------------------------------------|
1173
+ ** |Field Name| Data Type|Description |
1174
+ ** |----------|----------|------------------------------------------|
1175
+ ** |HEADER | Structure|An sqloptheader structure. |
1176
+ ** |----------|----------|------------------------------------------|
1177
+ ** |OPTION | Array |An array of sqloptions structures. The |
1178
+ ** | | |number of elements in this array is |
1179
+ ** | | |determined by the value of the allocated |
1180
+ ** | | |field of the header. |
1181
+ ** |----------|----------|------------------------------------------|
1182
+
1183
+ ** COBOL Structure
1184
+
1185
+ ** * File: sql.cbl
1186
+ ** 01 SQLOPT.
1187
+ ** 05 SQLOPTHEADER.
1188
+ ** 10 ALLOCATED PIC 9(9) COMP-5.
1189
+ ** 10 USED PIC 9(9) COMP-5.
1190
+ ** 05 SQLOPTIONS OCCURS 1 TO 50 DEPENDING ON ALLOCATED.
1191
+ ** 10 SQLOPT-TYPE PIC 9(9) COMP-5.
1192
+ ** 10 SQLOPT-VAL PIC 9(9) COMP-5.
1193
+ ** 10 SQLOPT-VAL-PTR REDEFINES SQLOPT-VAL
1194
+ ** *
1195
+ *******************************************************************************/
1196
+ SQL_STRUCTURE sqlopt
1197
+ {
1198
+ SQL_STRUCTURE sqloptheader header; /* Header for sqlopt structure */
1199
+ SQL_STRUCTURE sqloptions option[1]; /* Array of bind/prep/rebind options */
1200
+ };
1201
+
1202
+ #define SQL_BIND_OPTS
1203
+ #endif
1204
+
1205
+ /* Values used for option[n].type in the sqloptions structure */
1206
+ /* of sqlabndx(), sqlaprep() and sqlarbnd(). */
1207
+ #define SQL_DATETIME_OPT 1 /* Option for date/time format - bind */
1208
+ /* and precompile option */
1209
+ #define SQL_STANDARDS_OPT 2 /* Option for standards level */
1210
+ /* compliance - precompile option */
1211
+ /* only */
1212
+ #define SQL_ISO_OPT 4 /* Option for isolation level - bind */
1213
+ /* and precompile option */
1214
+ #define SQL_BLOCK_OPT 5 /* Option for record blocking - bind */
1215
+ /* and precompile option */
1216
+ #define SQL_GRANT_OPT 6 /* Option for granting privileges - */
1217
+ /* bind option only */
1218
+ #define SQL_FLAG_OPT 8 /* Option for the Flagger - */
1219
+ /* precompile option only */
1220
+ #define SQL_GRANT_USER_OPT 9 /* Option for granting privileges to */
1221
+ /* a user - bind option only */
1222
+ #define SQL_GRANT_GROUP_OPT 10 /* Option for granting privileges to */
1223
+ /* a group - bind option only */
1224
+ #define SQL_CNULREQD_OPT 11 /* Option for adding NULLs to strings */
1225
+ /* - bind option only */
1226
+ #define SQL_GENERIC_OPT 12 /* Generic option for DRDA servers - */
1227
+ /* bind option only */
1228
+ #define SQL_DEFERRED_PREPARE_OPT 15 /* Option for Deferred Prepare - */
1229
+ /* precompile option only */
1230
+ #define SQL_CONNECT_OPT 16 /* Specifies whether one or multiple */
1231
+ /* connections are allowed */
1232
+ /* similtaneously within a unit of */
1233
+ /* work. */
1234
+ #define SQL_RULES_OPT 17 /* Specifies the set of rules used */
1235
+ /* for connection to multiple */
1236
+ /* databases within a single unit of */
1237
+ /* work */
1238
+ #define SQL_DISCONNECT_OPT 18 /* Specifies which of multiple */
1239
+ /* databases connected to will be */
1240
+ /* disconnected when a COMMIT or */
1241
+ /* ROLLBACK is issued. */
1242
+ #define SQL_SYNCPOINT_OPT 19 /* Specifies what syncpoint option */
1243
+ /* (for example one phase or two */
1244
+ /* phase) will be used */
1245
+ #define SQL_BIND_OPT 20 /* Option to create a bind file - */
1246
+ /* precompile option only */
1247
+ #define SQL_SAA_OPT 21 /* Option specifies SAA/non-SAA */
1248
+ /* compatibility - FORTRAN precompile */
1249
+ /* option only */
1250
+ #define SQL_PKG_OPT 23 /* Option to create a package with a */
1251
+ /* specific name - precompile option */
1252
+ /* only */
1253
+ #define SQL_OPTIM_OPT 24 /* Option to specify SQLDA */
1254
+ /* optimization - precompile option */
1255
+ /* only */
1256
+ #define SQL_SYNTAX_OPT 25 /* Option to not create a package or */
1257
+ /* bind file - precompile option only */
1258
+ #define SQL_SQLERROR_OPT SQL_SYNTAX_OPT /* Indicates under what */
1259
+ /* conditions a package will be be */
1260
+ /* created - bind and precompile */
1261
+ /* option */
1262
+ #define SQL_LINEMACRO_OPT 26 /* Option to suppress #line macro */
1263
+ /* generation in modified source file */
1264
+ /* - C precompile option only */
1265
+ #define SQL_NO_OPT 27 /* 'No-op' option - ignore this entry */
1266
+ /* in the option array - bind, */
1267
+ /* precompile and rebind option */
1268
+ #define SQL_LEVEL_OPT 30 /* Level of a module - precompile */
1269
+ /* option only */
1270
+ #define SQL_COLLECTION_OPT 31 /* Package collection identifier - */
1271
+ /* precompile option only */
1272
+ #define SQL_VERSION_OPT 32 /* Package version identifier - */
1273
+ /* precompile and rebind option only */
1274
+ #define SQL_OWNER_OPT 33 /* Package owner authorization */
1275
+ /* identifier - bind and precompile */
1276
+ /* option */
1277
+ #define SQL_SCHEMA_OPT SQL_OWNER_OPT /* Synonym for owner - bind and */
1278
+ /* precompile option */
1279
+ #define SQL_QUALIFIER_OPT 34 /* Authorization identifier that is */
1280
+ /* to be used as a qualifier for */
1281
+ /* unqualified objects - bind and */
1282
+ /* precompile option */
1283
+ #define SQL_CATALOG_OPT SQL_QUALIFIER_OPT /* Synonym for qualifier - */
1284
+ /* bind and precompile option */
1285
+ #define SQL_TEXT_OPT 35 /* Package description - bind and */
1286
+ /* precompile option */
1287
+ #define SQL_VALIDATE_OPT 40 /* Indicates when object validation */
1288
+ /* occurs - bind and precompile */
1289
+ /* option */
1290
+ #define SQL_EXPLAIN_OPT 41 /* Determines whether information */
1291
+ /* will be produced about how the SQL */
1292
+ /* statements in a package will be */
1293
+ /* executed - bind and precompile */
1294
+ /* option */
1295
+ #define SQL_ACTION_OPT 42 /* Indicates whether a package is to */
1296
+ /* be added or replaced - bind and */
1297
+ /* precompile option */
1298
+ #define SQL_REPLVER_OPT 44 /* Replaces a specific version of a */
1299
+ /* package - bind and precompile */
1300
+ /* option */
1301
+ #define SQL_RETAIN_OPT 45 /* Indicates whether EXECUTE */
1302
+ /* authorities are to be preserved */
1303
+ /* when a package is replaced - bind */
1304
+ /* and precompile option */
1305
+ #define SQL_RELEASE_OPT 46 /* Indicates whether resources are */
1306
+ /* released at each COMMIT or when */
1307
+ /* the application terminates - bind */
1308
+ /* and precompile option */
1309
+ #define SQL_DEGREE_OPT 47 /* Specifies whether or not the query */
1310
+ /* is executed using I/O parallelism */
1311
+ /* bind and precompile option */
1312
+ #define SQL_STRDEL_OPT 50 /* Designates whether an apostrophe */
1313
+ /* or quote will be used as a string */
1314
+ /* delimiter - bind and precompile */
1315
+ /* option */
1316
+ #define SQL_DECDEL_OPT 51 /* Designates whether a period or */
1317
+ /* comma will be used as a decimal */
1318
+ /* point indicator - bind and */
1319
+ /* precompile option */
1320
+ #define SQL_CHARSUB_OPT 55 /* Designates default character */
1321
+ /* subtype that is to be used for */
1322
+ /* column definitions in the CREATE */
1323
+ /* and ALTER TABLE SQL statements - */
1324
+ /* bind and precompile option */
1325
+ #define SQL_CCSIDS_OPT 56 /* Designates what CCSID will be used */
1326
+ /* for single byte characters for */
1327
+ /* character column definitions */
1328
+ /* without a specific CCSID clause in */
1329
+ /* the CREATE and ALTER TABLE SQL */
1330
+ /* statements - bind and precompile */
1331
+ /* option */
1332
+ #define SQL_CCSIDM_OPT 57 /* Designates what CCSID will be used */
1333
+ /* for mixed byte characters for */
1334
+ /* character column definitions */
1335
+ /* without a specific CCSID clause in */
1336
+ /* the CREATE and ALTER TABLE SQL */
1337
+ /* statements - bind and precompile */
1338
+ /* option */
1339
+ #define SQL_CCSIDG_OPT 58 /* Designates what CCSID will be used */
1340
+ /* for double byte characters for */
1341
+ /* character column definitions */
1342
+ /* without a specific CCSID clause in */
1343
+ /* the CREATE and ALTER TABLE SQL */
1344
+ /* statements - bind and precompile */
1345
+ /* option */
1346
+ #define SQL_DEC_OPT 59 /* Specifies maximum precision to be */
1347
+ /* used in decimal arithmetic */
1348
+ /* operations - bind and precompile */
1349
+ /* option */
1350
+ #define SQL_WCHAR_OPT 60 /* Specifies handling of graphic */
1351
+ /* vars. - precompile only */
1352
+ #define SQL_DYNAMICRULES_OPT 61 /* Specifies which authorization */
1353
+ /* identifier to use when dynamic SQL */
1354
+ /* in a package is executed - bind */
1355
+ /* and precompile option */
1356
+ #define SQL_INSERT_OPT 62 /* Buffers VALUE inserts - bind and */
1357
+ /* precompile option for DB2/PE */
1358
+ /* servers only */
1359
+ #define SQL_EXPLSNAP_OPT 63 /* Capture explain snapshot - bind */
1360
+ /* and precompile option */
1361
+ #define SQL_FUNCTION_PATH 64 /* Path for user-defined function */
1362
+ /* resolution - bind and precompile */
1363
+ /* option */
1364
+ #define SQL_SQLWARN_OPT 65 /* Disable prepare-time SQL warnings */
1365
+ /* bind and precompile option */
1366
+ #define SQL_QUERYOPT_OPT 66 /* Set query optimization class - */
1367
+ /* bind and precompile option */
1368
+ #define SQL_TARGET_OPT 67 /* Target compiler - precompile */
1369
+ /* option */
1370
+ #define SQL_PREP_OUTPUT_OPT 68 /* Name of precompiler output file - */
1371
+ /* precompile option */
1372
+ #define SQL_PREPROCESSOR_OPT 69 /* Preprocessor command - precompile */
1373
+ /* option only */
1374
+ #define SQL_RESOLVE_OPT 70 /* Indicates whether function and */
1375
+ /* type resolution should or should */
1376
+ /* not use conservative binding */
1377
+ /* semantics - rebind option only */
1378
+ #define SQL_CLIPKG_OPT 71 /* CLIPKG option - bind option only */
1379
+ #define SQL_FEDERATED_OPT 72 /* FEDERATED option - bind and */
1380
+ /* precompile option */
1381
+ #define SQL_TRANSFORMGROUP_OPT 73 /* Transform Group - precompile and */
1382
+ /* bind option */
1383
+ #define SQL_LONGERROR_OPT 74 /* Option to treat long host variable */
1384
+ /* declarations as errors - */
1385
+ /* precompile option only */
1386
+ #define SQL_DECTYPE_OPT 75 /* DECTYPE Option to convert decimals */
1387
+ /* precompile option only */
1388
+ #define SQL_KEEPDYNAMIC_OPT 76 /* Specifies whether dynamic SQL */
1389
+ /* statements are to be kept after */
1390
+ /* commit points - bind and */
1391
+ /* precompile option */
1392
+ #define SQL_DBPROTOCOL_OPT 77 /* Specifies what protocol to use */
1393
+ /* when connecting to a remote site */
1394
+ /* that is identified by a three-part */
1395
+ /* name statement - bind and */
1396
+ /* precompile option */
1397
+ #define SQL_OPTHINT_OPT 78 /* Controls whether query */
1398
+ /* optimization hints are used for */
1399
+ /* static SQL - bind and precompile */
1400
+ /* option */
1401
+ #define SQL_IMMEDWRITE_OPT 79 /* Tells whether immediate writes */
1402
+ /* will be done for updates made to */
1403
+ /* group buffer pool dependent */
1404
+ /* pagesets or partitions - bind and */
1405
+ /* precompile option */
1406
+ #define SQL_ENCODING_OPT 80 /* Specifies the encoding for all */
1407
+ /* host variables in static */
1408
+ /* statements in the plan or package */
1409
+ /* (bind and precompile option) */
1410
+ #define SQL_OS400NAMING_OPT 81 /* Specifies which naming option is */
1411
+ /* to be used when accessing DB2 UDB */
1412
+ /* for iSeries data - bind and */
1413
+ /* precompile option */
1414
+ #define SQL_SORTSEQ_OPT 82 /* Specifies which sort sequence */
1415
+ /* table to use on the iSeries system */
1416
+ /* - bind and precompile option */
1417
+ #define SQL_REOPT_OPT 83 /* Specifies whether to have DB2 */
1418
+ /* determine an access path at run */
1419
+ /* time using values for host */
1420
+ /* variables, parameter markers, and */
1421
+ /* special registers - bind and */
1422
+ /* precompile option */
1423
+ #define SQL_PSM_OPT 84 /* PSM option - bind option */
1424
+ #define SQL_CALL_RES_OPT 85 /* Specifies whether to use immediate */
1425
+ /* ordeferred procedure */
1426
+ /* resolutionprecompile option */
1427
+ #define SQL_TIMESTAMP_OPT 86 /* Option for date/time format - bind */
1428
+ /* and precompile option */
1429
+ #define SQL_STATICREADONLY_OPT 87 /* Specifies whether static cursors */
1430
+ /* will be treated as read-only or */
1431
+ /* read-only and insensitive if they */
1432
+ /* are ambiguous - precompile and */
1433
+ /* bind option */
1434
+ #define SQL_OPTPROFILE_OPT 88 /* Specifies a two-part name of the */
1435
+ /* form [schemaname.]basename where */
1436
+ /* basename is a character string of */
1437
+ /* up to 128 chars in length used to */
1438
+ /* uniquely identify the optimization */
1439
+ /* profile within a particular */
1440
+ /* schema. Schemaname is a character */
1441
+ /* string identifier of up to 30 */
1442
+ /* bytes used to explicitelyqualify */
1443
+ /* an optimization profile schema. */
1444
+ #define SQL_FEDASYNC_OPT 89 /* Specifies whether or not the query */
1445
+ /* is executed using asynchrony */
1446
+ #define SQL_NODB_OPT 90 /* Specifies that a database should */
1447
+ /* not be used during precompile. */
1448
+ /* The BINDFILE and VALIDATE RUN */
1449
+ /* options will be implicitely */
1450
+ /* specified. */
1451
+ #define SQL_GRANT_ROLE_OPT 91 /* Option for granting privileges to */
1452
+ /* a role - bind option only */
1453
+ #define SQL_CONCURRENTAR_OPT 92 /* Option for concurrent access */
1454
+ /* resolution */
1455
+ #define SQL_APREUSE_OPT 93 /* Specifies whether or not the */
1456
+ /* compiler should use an access plan */
1457
+ /* which is similar to the one */
1458
+ /* currently stored in the package if */
1459
+ /* it already exists - bind, rebind */
1460
+ /* and precompile option */
1461
+ #define SQL_EXTENDEDINDICATOR_OPT 94 /* Option for extended indicator */
1462
+ /* support */
1463
+ #define SQL_COMPT_MODE_OPT 95 /* Specifies handling of new */
1464
+ /* compatible mode syntax - */
1465
+ /* precompile only */
1466
+ #define SQL_BUSTIMESENSITIVE_OPT 96 /* Option for determining whether to */
1467
+ /* add AS OF clauses to selects on */
1468
+ /* temporal tables, if CURRENT */
1469
+ /* TEMPORAL BUSINESS_TIME special */
1470
+ /* register is set */
1471
+ #define SQL_SYSTIMESENSITIVE_OPT 97 /* Option for determining whether to */
1472
+ /* add AS OF clauses to selects on */
1473
+ /* temporal tables, if CURRENT */
1474
+ /* TEMPORAL SYSTEM_TIME special */
1475
+ /* register is set */
1476
+ #define SQL_RECORDTEMPORALHISTORY_OPT 98 /* Option to override whether */
1477
+ /* temporal table IUD operations */
1478
+ /* insert rows into a history table */
1479
+ #define SQL_UNSAFENULL_OPT 99 /* Handling of NULL value during */
1480
+ /* retrieval of data - precompile */
1481
+ /* only */
1482
+ #define SQL_STRING_UNITS_OPT 100 /* Specifies whether the default */
1483
+ /* STRING_UNITS for character-based */
1484
+ /* type specifications in statements */
1485
+ /* compiled during BIND will be */
1486
+ /* SYSTEM or CODEUNITS32 - bind and */
1487
+ /* precompile option. */
1488
+
1489
+ #define SQL_NUM_OPTS 100 /* # of PREP/BIND/REBIND options */
1490
+
1491
+ /* Values used for option[n].val when option[n].type is */
1492
+ /* SQL_DATETIME_OPT. These can also be used for the date/time */
1493
+ /* format parameter of sqlabind(). */
1494
+
1495
+ #define SQL_DATETIME_DEF 48 /* FORMAT = Default for Country Code */
1496
+ #define SQL_DATETIME_USA 49 /* FORMAT = USA */
1497
+ #define SQL_DATETIME_EUR 50 /* FORMAT = EUR */
1498
+ #define SQL_DATETIME_ISO 51 /* FORMAT = ISO */
1499
+ #define SQL_DATETIME_JIS 52 /* FORMAT = JIS */
1500
+ #define SQL_DATETIME_LOC 53 /* FORMAT = LOCAL */
1501
+
1502
+ /* The following constants are here for backwards compatbility with earlier */
1503
+ /* releases. */
1504
+
1505
+ #define SQL_FRMT_OPT SQL_DATETIME_OPT
1506
+ #define SQL_FMT_0 SQL_DATETIME_DEF
1507
+ #define SQL_FMT_1 SQL_DATETIME_USA
1508
+ #define SQL_FMT_2 SQL_DATETIME_EUR
1509
+ #define SQL_FMT_3 SQL_DATETIME_ISO
1510
+ #define SQL_FMT_4 SQL_DATETIME_JIS
1511
+ #define SQL_FMT_5 SQL_DATETIME_LOC
1512
+
1513
+ /* Values used for option[n].val when option[n].type is SQL_STANDARDS_OPT. */
1514
+ #define SQL_SAA_COMP 0 /* SAA Level 1 Database CPI */
1515
+ #define SQL_MIA_COMP 1 /* MIA */
1516
+ #define SQL_SQL92E_COMP 2 /* SQL92 Entry */
1517
+
1518
+ /* Values used for option[n].val when option[n].type is SQL_ISO_OPT */
1519
+ #define SQL_REP_READ 0 /* Repeatable read level */
1520
+ #define SQL_CURSOR_STAB 1 /* Cursor stability level */
1521
+ #define SQL_UNCOM_READ 2 /* Uncommitted read level */
1522
+ #define SQL_READ_STAB 3 /* Read stability level */
1523
+ #define SQL_NO_COMMIT 4 /* No Commit level l */
1524
+
1525
+ /* Values used for option[n].val when option[n].type is SQL_BLOCK_OPT */
1526
+ #define SQL_BL_UNAMBIG 0 /* Block Unambiguous cursors */
1527
+ #define SQL_BL_ALL 1 /* Block All cursors */
1528
+ #define SQL_NO_BL 2 /* Block No cursors */
1529
+
1530
+ /* Values used for option[n].val when option[n].type is SQL_FLAG_OPT */
1531
+ #define SQL_MVSDB2V23_SYNTAX 4 /* Flagger check against MVS */
1532
+ #define SQL_MVSDB2V31_SYNTAX 5 /* DB2 V2.3, V3.1 or V4.1 SQL */
1533
+ #define SQL_MVSDB2V41_SYNTAX 6 /* syntax */
1534
+ #define SQL_SQL92E_SYNTAX 7 /* FIPS flagger SQL92E syntax */
1535
+
1536
+ /* Values used for option[n].val when option[n].type is SQL_CNULREQD_OPT */
1537
+ #define SQL_CNULREQD_NO 0 /* C NULL value not required */
1538
+ #define SQL_CNULREQD_YES 1 /* C NULL value required */
1539
+
1540
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1541
+ /* GENERIC_OPT */
1542
+ #define SQL_MAX_GENERIC 4096
1543
+
1544
+ /* Values used for option[n].val when option[n].type is SQL_SAA_OPT. */
1545
+ #define SQL_SAA_NO 0 /* SQLCA definition not SAA */
1546
+ /* compatible */
1547
+ #define SQL_SAA_YES 1 /* SQLCA definition is SAA compatible */
1548
+
1549
+ /* Values used for option[n].val when option[n].type is SQL_OPTIM_OPT. */
1550
+ #define SQL_DONT_OPTIMIZE 0 /* Do not optimize SQLDA */
1551
+ /* initialization */
1552
+ #define SQL_OPTIMIZE 1 /* Optimize SQLDA initialization */
1553
+
1554
+ /* Values used for option[n].val when option[n].type is SQL_SYNTAX_OPT. */
1555
+ #define SQL_NO_SYNTAX_CHECK 0 /* Create a package and/or a bind */
1556
+ /* file */
1557
+ #define SQL_SYNTAX_CHECK 1 /* Do not create a package or bind */
1558
+ /* file */
1559
+
1560
+ /* Values used for option[n].val when option[n].type is SQL_LINEMACRO_OPT. */
1561
+ #define SQL_NO_LINE_MACROS 0 /* Do not generate #line macros in */
1562
+ /* modified source file */
1563
+ #define SQL_LINE_MACROS 1 /* Generate #line macros in modified */
1564
+ /* source file */
1565
+
1566
+ /* Values used for option[n].val when option[n].type is SQL_WCHAR_OPT. */
1567
+ #define SQL_WCHAR_NOCONVERT 0 /* graphic variable not converted */
1568
+ #define SQL_WCHAR_CONVERT 1 /* graphic variable converted */
1569
+
1570
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL_LEVEL */
1571
+ /* OPT */
1572
+ #define SQL_MAX_LEVEL 8
1573
+
1574
+ /* Values used for option[n].val when option[n].type is SQL_CONNECT_OPT */
1575
+ #define SQL_DEFERRED_PREPARE_YES 1 /* Dynamic SQL statements will be */
1576
+ /* chained. */
1577
+ #define SQL_DEFERRED_PREPARE_NO 2 /* Dynamic SQL statements will not be */
1578
+ /* chained. */
1579
+ #define SQL_DEFERRED_PREPARE_ALL 3 /* Dynamic SQL statements will be */
1580
+ /* chained in all cases. The */
1581
+ /* application must not allocate host */
1582
+ /* vars a FETCH SQLDA until after the */
1583
+ /* OPEN statement for the cursor. */
1584
+
1585
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1586
+ /* COLLECTION_OPT */
1587
+ #define SQL_MAX_COLLECTION 128
1588
+
1589
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1590
+ /* VERSION_OPT */
1591
+ #define SQL_MAX_VERSION 254
1592
+
1593
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL_OWNER */
1594
+ /* OPT */
1595
+ #define SQL_MAX_OWNER 128
1596
+
1597
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1598
+ /* SCHEMA_OPT */
1599
+ #define SQL_MAX_SCHEMA SQL_MAX_OWNER
1600
+
1601
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1602
+ /* QUALIFIER_OPT */
1603
+ #define SQL_MAX_QUALIFIER 128
1604
+
1605
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1606
+ /* CATALOG_OPT */
1607
+ #define SQL_MAX_CATALOG SQL_MAX_QUALIFIER
1608
+
1609
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL_TEXT */
1610
+ /* OPT */
1611
+ #define SQL_MAX_TEXT 255
1612
+
1613
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1614
+ /* PREPROCESSOR_OPT */
1615
+ #define SQL_MAX_PREPROCESSOR 1024
1616
+
1617
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1618
+ /* TRANSFORMGROUP_OPT */
1619
+ #define SQL_MAX_TRANSFORMGROUP 18
1620
+
1621
+ /* Values used for option[n].val when option[n].type is SQL_VALIDATE_OPT */
1622
+ #define SQL_VALIDATE_BIND 0 /* Validate objects during BIND */
1623
+ #define SQL_VALIDATE_RUN 1 /* Validate objects during execution */
1624
+
1625
+ /* Values used for option[n].val when option[n].type is SQL_EXPLAIN_OPT */
1626
+ #define SQL_EXPLAIN_NO 0 /* No Explain output saved */
1627
+ #define SQL_EXPLAIN_YES 1 /* Explain output saved */
1628
+ #define SQL_EXPLAIN_ALL 2 /* Explain output saved for all */
1629
+ /* static and dynamic statements */
1630
+ #define SQL_EXPLAIN_REOPT 3 /* Explain output saved for static */
1631
+ /* reoptimizable statements */
1632
+ #define SQL_EXPLAIN_ONLY 4 /* Explain output saved for chosen */
1633
+ /* access plan */
1634
+
1635
+ /* Values used for option[n].val when option[n].type is SQL_ACTION_OPT */
1636
+ #define SQL_ACTION_ADD 0 /* Package is to be added */
1637
+ #define SQL_ACTION_REPLACE 1 /* Package is to be replaced */
1638
+
1639
+ /* Max/Min value of CLIPKG for option[n].val when option[n].type is SQL */
1640
+ /* CLIPKG_OPT */
1641
+ #define SQL_MIN_CLIPKG 3
1642
+ #define SQL_MAX_CLIPKG 30
1643
+
1644
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1645
+ /* REPLVER_OPT */
1646
+ #define SQL_MAX_REPLVER 254
1647
+
1648
+ /* Values used for option[n].val when option[n].type is SQL_SQLERROR_OPT */
1649
+ #define SQL_SQLERROR_NOPACKAGE SQL_NO_SYNTAX_CHECK /* Do not create a */
1650
+ /* package if errors are encountered */
1651
+ #define SQL_SQLERROR_CHECK SQL_SYNTAX_CHECK /* Do not create a package */
1652
+ #define SQL_SQLERROR_CONTINUE 2 /* Create a package even if errors */
1653
+ /* are encountered */
1654
+
1655
+ /* Values used for option[n].val when option[n].type is SQL_RETAIN_OPT */
1656
+ #define SQL_RETAIN_NO 0 /* Do not preserve EXECUTE */
1657
+ /* authorities when a package is */
1658
+ /* replaced */
1659
+ #define SQL_RETAIN_YES 1 /* Preserve EXECUTE authorities when */
1660
+ /* a package is replaced */
1661
+
1662
+ /* Values used for option[n].val when option[n].type is SQL_RELEASE_OPT */
1663
+ #define SQL_RELEASE_COMMIT 0 /* Release resources at COMMIT */
1664
+ #define SQL_RELEASE_DEALLOCATE 1 /* Release resources when the program */
1665
+ /* terminates */
1666
+
1667
+ /* Values used for option[n].val when option[n].type is SQL_STRDEL_OPT */
1668
+ #define SQL_STRDEL_APOSTROPHE 0 /* Apostrophe string delimiter */
1669
+ #define SQL_STRDEL_QUOTE 1 /* Quote string delimiter */
1670
+
1671
+ /* Values used for option[n].val when option[n].type is SQL_DECDEL_OPT */
1672
+ #define SQL_DECDEL_PERIOD 0 /* Period is used as a decimal point */
1673
+ /* indicator in decimal and floating */
1674
+ /* point literals */
1675
+ #define SQL_DECDEL_COMMA 1 /* Comma is used as a decimal point */
1676
+ /* indicator in decimal and floating */
1677
+ /* point literals */
1678
+
1679
+ /* Values used for option[n].val when option[n].type is SQL_CHARSUB_OPT */
1680
+ #define SQL_CHARSUB_DEFAULT 0 /* Use the target system defined */
1681
+ /* default for all new character */
1682
+ /* columns for which an explicit */
1683
+ /* subtype is not specified */
1684
+ #define SQL_CHARSUB_BIT 1 /* Use the BIT character subtype for */
1685
+ /* all new character columns for */
1686
+ /* which an explicit subtype is not */
1687
+ /* specified */
1688
+ #define SQL_CHARSUB_SBCS 2 /* Use the SBCS character subtype for */
1689
+ /* all new character columns for */
1690
+ /* which an explicit subtype is not */
1691
+ /* specified */
1692
+ #define SQL_CHARSUB_MIXED 3 /* Use the mixed character subtype */
1693
+ /* for all new character columns for */
1694
+ /* which an explicit subtype is not */
1695
+ /* specified */
1696
+
1697
+ /* Values used for option[n].val when option[n].type is SQL_DEC_OPT */
1698
+ #define SQL_DEC_15 15 /* 15 bit precision is used in */
1699
+ /* decimal arithmetic operations */
1700
+ #define SQL_DEC_31 31 /* 31 bit precision is used in */
1701
+ /* decimal arithmetic operations */
1702
+
1703
+ /* Values used for option[n].val when option[n].type is SQL_DEGREE_OPT */
1704
+ #define SQL_DEGREE_1 1 /* Prohibits parallel I/O operations */
1705
+ #define SQL_DEGREE_ANY 0 /* Allows the target database system */
1706
+ /* to determine the degree of */
1707
+ /* parallel I/O operations */
1708
+ #define SQL_MAX_DEGREE_VAL 32767 /* Maximum value */
1709
+
1710
+ /* Values used for option[n].val when option[n].type is SQL_VERSION_OPT */
1711
+ #define SQL_VERSION_AUTO "AUTO" /* Use the timestamp to generate the */
1712
+ /* package VERSION */
1713
+
1714
+ /* The next four option values (for CONNECT type, SQLRULES, DISCONNECT and */
1715
+ /* SYNCPOINT) are used not only by the precompiler but also by the sqlesetc */
1716
+ /* and sqleqryc APIs. */
1717
+
1718
+ /* Values used for option[n].val when option[n].type is SQL_CONNECT_OPT */
1719
+ #define SQL_CONNECT_1 1 /* Indicates that only one connection */
1720
+ /* to a database can exist at any */
1721
+ /* given time. */
1722
+ #define SQL_CONNECT_2 2 /* Indicates that multiple */
1723
+ /* connections can exist */
1724
+ /* simultaneously, with one being */
1725
+ /* active and the others dormant. */
1726
+
1727
+ /* Values used for option[n].val when option[n].type is SQL_RULES_OPT */
1728
+ #define SQL_RULES_DB2 1 /* Indicates that CONNECT TO can be */
1729
+ /* used to make a dormant connection */
1730
+ /* the current connection. */
1731
+ #define SQL_RULES_STD 2 /* Indicates that CONNECT TO is not */
1732
+ /* valid for making a dormant */
1733
+ /* connection current, and SET */
1734
+ /* CONNECTION must be used instead. */
1735
+
1736
+ /* Values used for option[n].val when option[n].type is SQL_DISCONNECT_OPT */
1737
+ #define SQL_DISCONNECT_EXPL 1 /* Indicates that all connections */
1738
+ /* marked by the RELEASE statement */
1739
+ /* will be the only connections */
1740
+ /* released when a COMMIT is issued. */
1741
+ #define SQL_DISCONNECT_COND 2 /* Indicates that all connections */
1742
+ /* that do not have open WITH HOLD */
1743
+ /* cursors will be the only */
1744
+ /* connections released when a COMMIT */
1745
+ /* is issued. */
1746
+ #define SQL_DISCONNECT_AUTO 3 /* Indicates that all connections */
1747
+ /* will be released when a COMMIT is */
1748
+ /* issued. */
1749
+
1750
+ /* Values used for option[n].val when option[n].type is SQL_SYNCPOINT_OPT */
1751
+ #define SQL_SYNC_ONEPHASE 1 /* Do not use a transaction manager */
1752
+ /* to perform two phase commit, but */
1753
+ /* enforce that there is only one */
1754
+ /* database is updated when multiple */
1755
+ /* databases are accessed within a */
1756
+ /* single transaction. */
1757
+ #define SQL_SYNC_TWOPHASE 2 /* Use a transaction manager to */
1758
+ /* coordinate two phase commit. */
1759
+ #define SQL_SYNC_NONE 0 /* No update enforcement or two phase */
1760
+ /* commit protocol will be used. */
1761
+
1762
+ /* The next option value (for SQL_CONNECT_NODE) is used only by the sqlesetc */
1763
+ /* and sqleqryc APIs. */
1764
+ #define SQL_CONN_CATALOG_NODE 0xfffe /* Connect to the catalog node */
1765
+
1766
+ /* Values used for option[n].val when option[n].type is SQL_DYNAMICRULES_OPT */
1767
+ #define SQL_DYNAMICRULES_RUN 0 /* Dynamic SQL in package will use */
1768
+ /* authid of person running the */
1769
+ /* package */
1770
+ #define SQL_DYNAMICRULES_BIND 1 /* Dynamic SQL in package will use */
1771
+ /* authid of person who owns the */
1772
+ /* package */
1773
+ #define SQL_DYNAMICRULES_INVOKERUN 2 /* Dynamic SQL in a routine will use */
1774
+ /* authid of invoker of routine */
1775
+ #define SQL_DYNAMICRULES_DEFINERUN 3 /* Dynamic SQL in a routine will use */
1776
+ /* authid of definer of routine */
1777
+ #define SQL_DYNAMICRULES_INVOKEBIND 4 /* Dynamic SQL in a routine will use */
1778
+ /* authid of invoker of routine */
1779
+ #define SQL_DYNAMICRULES_DEFINEBIND 5 /* Dynamic SQL in a routine will use */
1780
+ /* authid of definer of routine */
1781
+
1782
+ /* Values used for option[n].val when option[n].type is SQL_INSERT_OPT */
1783
+ #define SQL_INSERT_DEF 0 /* Do not buffer VALUE inserts */
1784
+ #define SQL_INSERT_BUF 1 /* Buffer VALUE inserts */
1785
+
1786
+ /* Values used for option[n].val when option[n].type is SQL_EXPLSNAP_OPT */
1787
+ #define SQL_EXPLSNAP_NO 0 /* No Explain snapshot saved */
1788
+ #define SQL_EXPLSNAP_YES 1 /* Explain snapshot saved */
1789
+ #define SQL_EXPLSNAP_ALL 2 /* Explain snapshot saved for all */
1790
+ /* static and dynamic statements */
1791
+ #define SQL_EXPLSNAP_REOPT 3 /* Explain snapshot saved for static */
1792
+ /* reoptimizable statements */
1793
+
1794
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1795
+ /* FUNCTION_PATH */
1796
+ #define SQL_MAX_FUNCPATH 2048
1797
+
1798
+ /* Values used for option[n].val when option[n].type is SQL_SQLWARN_OPT */
1799
+ #define SQL_SQLWARN_NO 0 /* Suppress prepare-time warning */
1800
+ /* SQLCODEs */
1801
+ #define SQL_SQLWARN_YES 1 /* Permit prepare-time warning */
1802
+ /* SQLCODEs */
1803
+
1804
+ /* Values used for option[n].val when option[n].type is SQL_QUERYOPT_OPT */
1805
+ #define SQL_QUERYOPT_0 0 /* Class 0 query optimization */
1806
+ #define SQL_QUERYOPT_1 1 /* Class 1 query optimization */
1807
+ #define SQL_QUERYOPT_2 2 /* Class 2 query optimization */
1808
+ #define SQL_QUERYOPT_3 3 /* Class 3 query optimization */
1809
+ #define SQL_QUERYOPT_5 5 /* Class 5 query optimization */
1810
+ #define SQL_QUERYOPT_7 7 /* Class 7 query optimization */
1811
+ #define SQL_QUERYOPT_9 9 /* Class 9 query optimization */
1812
+
1813
+ /* Maximum sqlchar length for option[n].val when option[n].type is SQL */
1814
+ /* TARGET_OPT */
1815
+ #define SQL_MAX_TARGET_LEN 32
1816
+
1817
+ /* Values used for option[n].val when option[n].type is SQL_RESOLVE_OPT */
1818
+ #define SQL_RESOLVE_ANY 0 /* Conservative binding semantics are */
1819
+ /* not used */
1820
+ #define SQL_RESOLVE_CONSERVATIVE 1 /* Conservative binding semantics are */
1821
+ /* used */
1822
+
1823
+ /* Values used for option[n].val when option[n].type is SQL_FEDERATED_OPT */
1824
+ #define SQL_FEDERATED_NO 0 /* Federated systems are not */
1825
+ /* supported */
1826
+ #define SQL_FEDERATED_YES 1 /* Federated systems are supported */
1827
+ /* Values used for option[n].val when option[n].type is SQL_PSM_OPT */
1828
+ #define SQL_PSM_NO 0 /* PSM no */
1829
+ #define SQL_PSM_YES 1 /* PSM yes */
1830
+
1831
+ /* Values used for option[n].val when option[n].type is SQL_LONGERROR_OPT. */
1832
+ #define SQL_LONGERROR_NO 0 /* Do not generate errors for the use */
1833
+ /* of long host variable declarations */
1834
+ #define SQL_LONGERROR_YES 1 /* Generate errors for the use of */
1835
+ /* long host variable declarations */
1836
+
1837
+ /* Values used for option[n].val when option[n].type is SQL_DECTYPE_OPT. */
1838
+ #define SQL_DECTYPE_NOCONVERT 0 /* Decimal type not converted */
1839
+ #define SQL_DECTYPE_CONVERT 1 /* Decimal type converted */
1840
+
1841
+ /* Values used for option[n].val when option[n].type is SQL_KEEPDYNAMIC_OPT */
1842
+ #define SQL_KEEPDYNAMIC_NO 0 /* Do not keep dynamic SQL statements */
1843
+ /* after commit points */
1844
+ #define SQL_KEEPDYNAMIC_YES 1 /* Keep dynamic SQL statements after */
1845
+ /* commit points */
1846
+
1847
+ /* Values used for option[n].val when option[n].type is SQL_DBPROTOCOL_OPT */
1848
+ #define SQL_DBPROTOCOL_DRDA 0 /* Use DRDA protocol when connecting */
1849
+ /* to a remote site that is */
1850
+ /* identified by a three-part name */
1851
+ /* statement */
1852
+ #define SQL_DBPROTOCOL_PRIVATE 1 /* Use a private protocol when */
1853
+ /* connecting to a remote site that */
1854
+ /* is identified by a three-part name */
1855
+ /* statement */
1856
+
1857
+ /* Values used for option[n].val when option[n].type is SQL_IMMEDWRITE_OPT */
1858
+ #define SQL_IMMEDWRITE_NO 0 /* Updated pages are written at or */
1859
+ /* before phase two of commit */
1860
+ #define SQL_IMMEDWRITE_YES 1 /* Updated pages are written as soon */
1861
+ /* as the buffer update completes */
1862
+ #define SQL_IMMEDWRITE_PH1 2 /* Updated pages are written at or */
1863
+ /* before phase one of commit */
1864
+
1865
+ /* Values used for option[n].val when option[n].type is SQL_ENCODING_OPT */
1866
+ #define SQL_ENCODING_ASCII 0 /* Host variables in static */
1867
+ /* statements are encoded in ascii */
1868
+ #define SQL_ENCODING_EBCDIC 1 /* Host variables in static */
1869
+ /* statements are encoded in ebcdic */
1870
+ #define SQL_ENCODING_UNICODE 2 /* Host variables in static */
1871
+ /* statements are encoded in unicode */
1872
+
1873
+ /* Values used for option[n].val when option[n].type is SQL_OS400NAMING_OPT */
1874
+ #define SQL_OS400NAMING_SYSTEM 0 /* Use the iSeries system naming */
1875
+ /* option when accessing DB2 UDB for */
1876
+ /* iSeries data */
1877
+ #define SQL_OS400NAMING_SQL 1 /* Use the SQL naming option when */
1878
+ /* accessing DB2 UDB for iSeries data */
1879
+
1880
+ /* Values used for option[n].val when option[n].type is SQL_SORTSEQ_OPT */
1881
+ #define SQL_SORTSEQ_JOBRUN 0 /* Use the NLSS sort sequence table */
1882
+ /* of the DRDA job on the iSeries */
1883
+ /* system */
1884
+ #define SQL_SORTSEQ_HEX 1 /* Use the EBCDIC sort sequence table */
1885
+ /* of the DRDA job on the iSeries */
1886
+ /* system */
1887
+
1888
+ /* Values used for option[n].val when option[n].type is SQL_REOPT_OPT */
1889
+ #define SQL_REOPT_NO 0 /* Do not determine an access path at */
1890
+ /* run time using values for host */
1891
+ /* variables, parameter markers, and */
1892
+ /* special registers */
1893
+ #define SQL_REOPT_YES 1 /* Re-determine an access path at run */
1894
+ /* time using values for host */
1895
+ /* variables, parameter markers, and */
1896
+ /* special registers */
1897
+ #define SQL_REOPT_NONE 2 /* The access path is determined */
1898
+ /* based on the default estimates for */
1899
+ /* host variables, parameter markers, */
1900
+ /* and special registers */
1901
+ #define SQL_REOPT_ONCE 3 /* Re-determine an access path only */
1902
+ /* once at run time using values for */
1903
+ /* host variables, parameter markers, */
1904
+ /* and special registers */
1905
+ #define SQL_REOPT_ALWAYS 4 /* Re-determine an access path at */
1906
+ /* every execution values for host */
1907
+ /* variables, parameter markers, and */
1908
+ /* special registers */
1909
+
1910
+ /* Values used for option[n].val when option[n].type is SQL_CALL_RES_OPT */
1911
+ #define SQL_CALL_RES_IMMED 0 /* Immediate SP call resolution */
1912
+ #define SQL_CALL_RES_DEFERRED 1 /* Deferred SP call resolution */
1913
+
1914
+ /* Values used for option[n].val when option[n].type is SQL_STATICREADONLY */
1915
+ /* OPT */
1916
+ #define SQL_STATICRO_NO 0 /* Static cursors take on attributes */
1917
+ /* as would normally be generated */
1918
+ /* given the statement text and */
1919
+ /* setting of the LANGLEVEL option. */
1920
+ #define SQL_STATICRO_YES 1 /* Any static cursor that does not */
1921
+ /* contain the FOR UPDATE or FOR READ */
1922
+ /* ONLY clause will be considered */
1923
+ /* READ ONLY. */
1924
+ #define SQL_STATICRO_INSENSITIVE 2 /* Any static cursor that does not */
1925
+ /* contain the FOR UPDATE or FOR READ */
1926
+ /* ONLY clause will be considered */
1927
+ /* READ ONLY and INSENSITIVE. */
1928
+
1929
+ /* Values used for option[n].val when option[n].type is SQL_NODB_OPT. */
1930
+ #define SQL_USEDB 0 /* Use a database to precompiler. */
1931
+ #define SQL_NODB 1 /* Do not use a database to */
1932
+ /* precompile. */
1933
+
1934
+ /* Values used for option[n].val when option[n].type is SQL_FEDASYNC_OPT */
1935
+ #define SQL_FEDASYNC_MIN 0 /* No asynchrony is used */
1936
+ #define SQL_FEDASYNC_ANY -1 /* Allows the optimizer to determine */
1937
+ /* the level of asynchrony */
1938
+ #define SQL_FEDASYNC_MAX 32767 /* Maximum value */
1939
+
1940
+ /* Values used for option[n].val when option[n].type is SQL_CONCURRENTAR_OPT */
1941
+ #define SQL_CONCURRENTAR_USE_CUR_COM 0 /* Use Currently committed values */
1942
+ #define SQL_CONCURRENTAR_WAIT_FOR_OC 1 /* Wait for results of an operation */
1943
+
1944
+ /* Values used for option[n].val when option[n].type is SQL_APREUSE_OPT */
1945
+ #define SQL_APREUSE_NO 0 /* The compiler should not attempt to */
1946
+ /* reuse the access plans in any */
1947
+ /* existing package during this BIND */
1948
+ /* REBIND nor for future implicit and */
1949
+ /* explicit REBINDs. */
1950
+ #define SQL_APREUSE_YES 1 /* The compiler should attempt to */
1951
+ /* reuse the access plans for the */
1952
+ /* statements in the package if it */
1953
+ /* exists for this BIND/REBIND and */
1954
+ /* future implicit and explicit */
1955
+ /* REBINDs. */
1956
+
1957
+ /* Values used for option[n].val when option[n].type is SQL */
1958
+ /* EXTENDEDINDICATOR_OPT */
1959
+ #define SQL_EXTENDEDINDICATOR_NO 0 /* Do not use extended indicator */
1960
+ /* support */
1961
+ #define SQL_EXTENDEDINDICATOR_YES 1 /* Use extended indicator support */
1962
+
1963
+ /* Values used for option[n].val when option[n].type is SQL_COMPT_MODE_OPT. */
1964
+ #define SQL_COMPT_MODE_NO 0 /* New compatible mode syntaxes are */
1965
+ /* not supported */
1966
+ #define SQL_COMPT_MODE_ORA 1 /* New compatible mode syntaxes are */
1967
+ /* supported */
1968
+ #define SQL_COMPT_MODE_ORA_NONCUM_FETCHCNT 2 /* New compatible mode syntaxes */
1969
+ /* except cumulative fetch count are */
1970
+ /* supported */
1971
+
1972
+ /* Values used for option[n].val when option[n].type is SQL_UNSAFENULL_OPT. */
1973
+ #define SQL_UNSAFENULL_YES 1 /* Specifying indicator to retreive */
1974
+ /* NULL valueis not required */
1975
+ #define SQL_UNSAFENULL_NO 2 /* Specifying indicator to retreive */
1976
+ /* NULL valueis mandatory */
1977
+
1978
+ /* Values used for option[n].val when option[n].type is SQL_BUSTIMESENSITIVE */
1979
+ /* OPT */
1980
+ #define SQL_BUSTIMESENSITIVE_NO 0 /* References to temporal tables are */
1981
+ /* not affected by CURRENT TEMPORAL */
1982
+ /* BUSINESS_TIME register */
1983
+ #define SQL_BUSTIMESENSITIVE_YES 1 /* References to temporal tables are */
1984
+ /* affected by CURRENT TEMPORAL */
1985
+ /* BUSINESS_TIME register */
1986
+ /* Values used for option[n].val when option[n].type is SQL_SYSTIMESENSITIVE */
1987
+ /* OPT */
1988
+ #define SQL_SYSTIMESENSITIVE_NO 0 /* References to temporal tables are */
1989
+ /* not affected by CURRENT TEMPORAL */
1990
+ /* SYSTEM_TIME register */
1991
+ #define SQL_SYSTIMESENSITIVE_YES 1 /* References to temporal tables are */
1992
+ /* affected by CURRENT TEMPORAL */
1993
+ /* SYSTEM_TIME register */
1994
+ /* Values used for option[n].val when option[n].type is SQL_STRING_UNITS_OPT */
1995
+ #define SQL_STRING_UNITS_SYS 0 /* The default STRING_UNITS for */
1996
+ /* character-based type */
1997
+ /* specifications in the statement */
1998
+ /* will be SYSTEM. */
1999
+ #define SQL_STRING_UNITS_CU32 1 /* The default STRING_UNITS for */
2000
+ /* character-based type */
2001
+ /* specifications in the statement */
2002
+ /* will be CODEUNITS32. */
2003
+ /* Binder Interface Parameters/Return Codes */
2004
+
2005
+ /******************************************************************************
2006
+ ** sqlabndx API
2007
+ ** Invokes the bind utility, which prepares SQL statements stored in the
2008
+ ** bind file generated by the precompiler, and creates a package that is
2009
+ ** stored in the database.
2010
+ **
2011
+ ** Scope
2012
+ **
2013
+ ** This API can be called from any database partition server in db2nodes.cfg. It
2014
+ ** updates the database catalogs on the catalog partition. Its effects are
2015
+ ** visible to all database partition servers.
2016
+ **
2017
+ ** Authorization
2018
+ **
2019
+ ** One of the following:
2020
+ ** - sysadm or dbadm authority
2021
+ ** - BINDADD privilege if a package does not exist and one of:
2022
+ ** -- IMPLICIT_SCHEMA authority on the database if the schema name
2023
+ ** of the package does not exist
2024
+ ** -- CREATEIN privilege on the schema if the schema name of the
2025
+ ** package exists
2026
+ ** - ALTERIN privilege on the schema if the package exists
2027
+ ** - BIND privilege on the package if it exists.
2028
+ **
2029
+ ** The user also needs all privileges required to compile any static SQL
2030
+ ** statements in the application. Privileges granted to groups are not used for
2031
+ ** authorization checking of static statements. If the user has sysadm
2032
+ ** authority, but not explicit privileges to complete the bind, the database
2033
+ ** manager grants explicit dbadm authority automatically.
2034
+ **
2035
+ ** Required connection
2036
+ **
2037
+ ** Database
2038
+ **
2039
+ ** API include file
2040
+ **
2041
+ ** sql.h
2042
+ **
2043
+ ** sqlabndx API parameters
2044
+ **
2045
+ ** pBindFileName
2046
+ ** Input. A string containing the name of the bind file, or the name of a file
2047
+ ** containing a list of bind file names. The bind file names must contain the
2048
+ ** extension .bnd. A path for these files can be specified.
2049
+ **
2050
+ ** Precede the name of a bind list file with the at sign (@). For example, a
2051
+ ** fully qualified bind list file name might be: /u/user1/bnd/@all.lst
2052
+ **
2053
+ ** The bind list file should contain one or more bind file names, and must have
2054
+ ** the extension .lst.
2055
+ **
2056
+ ** Precede all but the first bind file name with a plus symbol (+). The bind
2057
+ ** file names may be on one or more lines. For example, the bind list file
2058
+ ** all.lst might contain:
2059
+ ** mybind1.bnd+mybind2.bnd+
2060
+ ** mybind3.bnd+
2061
+ ** mybind4.bnd
2062
+ **
2063
+ ** Path specifications on bind file names in the list file can be used.
2064
+ ** If no path is specified, the database manager takes path information
2065
+ ** from the bind list file.
2066
+ **
2067
+ ** pMsgFileName
2068
+ ** Input. A string containing the destination for error, warning, and
2069
+ ** informational messages. Can be the path and the name of an operating system
2070
+ ** file, or a standard device. If a file already exists, it is overwritten.
2071
+ ** If it does not exist, a file is created.
2072
+ **
2073
+ ** pBindOptions
2074
+ ** Input. A structure used to pass bind options to the API. For more information
2075
+ ** about this structure, see SQLOPT.
2076
+ **
2077
+ ** pSqlca
2078
+ ** Output. A pointer to the sqlca structure.
2079
+ **
2080
+ ** Usage notes
2081
+ **
2082
+ ** Binding can be done as part of the precompile process for an application
2083
+ ** program source file, or as a separate step at a later time. Use BIND when
2084
+ ** binding is performed as a separate process.
2085
+ **
2086
+ ** The name used to create the package is stored in the bind file, and is
2087
+ ** based on the source file name from which it was generated (existing paths
2088
+ ** or extensions are discarded). For example, a precompiled source file
2089
+ ** called myapp.sqc generates a default bind file called myapp.bnd and a
2090
+ ** default package name of MYAPP. (However,
2091
+ ** the bind file name and the
2092
+ ** package name can be overridden at precompile time by using the
2093
+ ** SQL_BIND_OPT and the SQL_PKG_OPT options of sqlaprep.)
2094
+ **
2095
+ ** BIND executes under the transaction that the user has started. After
2096
+ ** performing the bind, BIND issues a COMMIT (if bind is successful) or a
2097
+ ** ROLLBACK (if bind is unsuccessful) operation to terminate the current
2098
+ ** transaction and start another one.
2099
+ **
2100
+ ** Binding halts if a fatal error or more than 100 errors occur. If a
2101
+ ** fatal error occurs during binding, BIND stops binding, attempts to
2102
+ ** close all files, and discards the package.
2103
+ **
2104
+ ** Binding application programs have prerequisite requirements and restrictions
2105
+ ** beyond the scope of this manual. For example, an application cannot be bound
2106
+ ** from a V8 client to a V8 server, and then executed against a V7 server.
2107
+ **
2108
+ ** The Bind option types and values are defined in sql.
2109
+ **
2110
+ ** REXX API syntax
2111
+ **
2112
+ ** This API can be called from REXX through the SQLDB2 interface.
2113
+ *******************************************************************************/
2114
+ SQL_API_RC SQL_API_FN /* Bind */
2115
+ sqlabndx (
2116
+ _SQLOLDCHAR * pBindFileName, /* bind file name */
2117
+ _SQLOLDCHAR * pMsgFileName, /* message file */
2118
+ struct sqlopt * pBindOptions, /* bind options */
2119
+ struct sqlca * pSqlca); /* SQLCA */
2120
+
2121
+ /******************************************************************************
2122
+ ** sqlarbnd API
2123
+ ** Allows the user to recreate a package stored in the database without the need
2124
+ ** for a bind file.
2125
+ **
2126
+ ** Authorization
2127
+ **
2128
+ ** One of the following:
2129
+ ** - sysadm or dbadm authority
2130
+ ** - ALTERIN privilege on the schema
2131
+ ** - BIND privilege on the package.
2132
+ **
2133
+ ** The authorization ID logged in the BOUNDBY column of the SYSCAT.PACKAGES
2134
+ ** system catalog table, which is the ID of the most recent binder of the
2135
+ ** package, is used as the binder authorization ID for the rebind, and for
2136
+ ** the default schema for table references in the package. Note that this
2137
+ ** default qualifier may be different from the authorization ID of the
2138
+ ** user executing the rebind request. REBIND will use the same bind
2139
+ ** options that were specified when the package was created.
2140
+ **
2141
+ ** Required connection
2142
+ **
2143
+ ** Database
2144
+ **
2145
+ ** API include file
2146
+ **
2147
+ ** sql.h
2148
+ **
2149
+ ** sqlarbnd API parameters
2150
+ **
2151
+ ** pPackageName
2152
+ ** Input. A string containing the qualified or unqualified name that designates
2153
+ ** the package to be rebound. An unqualified package-name is implicitly
2154
+ ** qualified by the current authorization ID. This name does not include the
2155
+ ** package version. When specifying a package that has a version that is not
2156
+ ** the empty string, then the version-id must be specified using the
2157
+ ** SQL_VERSION_OPT rebind option.
2158
+ **
2159
+ ** pSqlca
2160
+ ** Output. A pointer to the sqlca structure.
2161
+ **
2162
+ ** pRebindOptions
2163
+ ** Input. A pointer to the SQLOPT structure, used to pass rebind options to the
2164
+ ** API. For more information about this structure, see SQLOPT.
2165
+ **
2166
+ ** Usage notes
2167
+ **
2168
+ ** REBIND does not automatically commit the transaction following a successful
2169
+ ** rebind. The user must explicitly commit the transaction. This enables
2170
+ ** "what if " analysis, in which the user updates certain statistics, and
2171
+ ** then tries to rebind the package to see what changes. It also permits
2172
+ ** multiple rebinds within a unit of work.
2173
+ **
2174
+ ** This API:
2175
+ **
2176
+ ** - Provides a quick way to recreate a package. This enables the user to take
2177
+ ** advantage of a change in the system without a need for the original
2178
+ ** bind file.fs. For example, if it is likely that a particular SQL
2179
+ ** statement can take advantage of a newly created index, REBIND can be
2180
+ ** used to recreate the package. REBIND can also be used to recreate
2181
+ ** packages after db2Runstats has been executed, thereby taking advantage
2182
+ ** of the new statistics.
2183
+ **
2184
+ ** - Provides a method to recreate inoperative packages. Inoperative packages
2185
+ ** must be explicitly rebound by invoking either the bind utility or the rebind
2186
+ ** utility. A package will be marked inoperative (the VALID column of the
2187
+ ** SYSCAT.PACKAGES system catalog will be set to X) if a function instance on
2188
+ ** which the package depends is dropped. The rebind conservative option is
2189
+ ** not supported for inoperative packages.
2190
+ **
2191
+ ** - Gives users control over the rebinding of invalid packages. Invalid
2192
+ ** packages will be automatically (or implicitly) rebound by the database
2193
+ ** manager when they are executed. This may result in a noticeable delay
2194
+ ** in the execution of the first SQL request for the invalid package. It
2195
+ ** may be desirable to explicitly rebind invalid packages, rather than
2196
+ ** allow the system to automatically rebind them, in order to eliminate
2197
+ ** the initial delay and to prevent unexpected SQL error messages which
2198
+ ** may be returned in case the implicit rebind fails. For example,
2199
+ ** following migration, all packages stored in the database will be
2200
+ ** invalidated by the DB2 Version 5 migration process. Given that this
2201
+ ** may involve a large number of packages, it may be desirable to
2202
+ ** explicitly rebind all of the invalid packages at one time. This
2203
+ ** explicit rebinding can be accomplished using BIND, REBIND, or the
2204
+ ** db2rbind tool.
2205
+ **
2206
+ ** The choice of whether to use BIND or REBIND to explicitly rebind a package
2207
+ ** depends on the circumstances. It is recommended that REBIND be used
2208
+ ** whenever the situation does not specifically require the use of BIND,
2209
+ ** since the performance of REBIND is significantly better than that of
2210
+ ** BIND. BIND must be used, however:
2211
+ **
2212
+ ** - When there have been modifications to the program (for example, when
2213
+ ** SQL statements have been added or deleted, or when the package does
2214
+ ** not match the executable for the program).
2215
+ **
2216
+ ** - When the user wishes to modify any of the bind options as part of the
2217
+ ** rebind. REBIND does not support any bind options. For example, if the user
2218
+ ** wishes to have privileges on the package granted as part of the bind
2219
+ ** process, BIND must be used, since it has an SQL_GRANT_OPT option.
2220
+ **
2221
+ ** - When the package does not currently exist in the database.
2222
+ **
2223
+ ** - When detection of all bind errors is desired. REBIND only returns the first
2224
+ ** error it detects, and then ends, whereas the BIND command returns the
2225
+ ** first 100 errors that occur during binding.
2226
+ **
2227
+ ** REBIND is supported by DB2 Connect.
2228
+ **
2229
+ ** If REBIND is executed on a package that is in use by another user, the rebind
2230
+ ** will not occur until the other user's logical unit of work ends, because an
2231
+ ** exclusive lock is held on the package's record in the SYSCAT.PACKAGES system
2232
+ ** catalog table during the rebind.
2233
+ **
2234
+ ** When REBIND is executed, the database manager recreates the package from
2235
+ ** the SQL statements stored in the SYSCAT.STATEMENTS system catalog table.
2236
+ ** If many versions with the same package number and creator exist, only one
2237
+ ** version can be bound at once. If not specified using the SQL_VERSION_OPT
2238
+ ** rebind option, the VERSION defaults to be "". Even if there is only one
2239
+ ** package with a name and creator that matches the name and creator specified
2240
+ ** in the rebind request, it will not rebound unless its VERSION matches the
2241
+ ** VERSION specified explicitly or implicitly.
2242
+ **
2243
+ ** If REBIND encounters an error, processing stops, and an error message is
2244
+ ** returned.
2245
+ **
2246
+ ** The Explain tables are populated during REBIND if either SQL_EXPLSNAP_OPT
2247
+ ** or SQL_EXPLAIN_OPT have been set to YES or ALL (check
2248
+ ** EXPLAIN_SNAPSHOT and EXPLAIN_MODE columns in the catalog). The Explain
2249
+ ** tables used are those of the REBIND requester, not the original binder.
2250
+ ** The Rebind option types and values are defined in sql.h.
2251
+ **
2252
+ ** REXX API syntax
2253
+ **
2254
+ ** This API can be called from REXX through the SQLDB2 interface.
2255
+ *******************************************************************************/
2256
+ SQL_API_RC SQL_API_FN /* Rebind */
2257
+ sqlarbnd (
2258
+ char * pPackageName, /* package name */
2259
+ struct sqlca * pSqlca, /* SQLCA */
2260
+ struct sqlopt * pRebindOptions); /* rebind options */
2261
+
2262
+ /******************************************************************************
2263
+ ** sqlaprep API
2264
+ ** Processes an application program source file containing embedded SQL
2265
+ ** statements. A modified source file is produced containing host language calls
2266
+ ** for the SQL statements and, by default, a package is created in the database.
2267
+ **
2268
+ ** Scope
2269
+ **
2270
+ ** This API can be called from any database partition server in db2nodes.cfg. It
2271
+ ** updates the database catalogs on the catalog partition. Its effects
2272
+ ** are visible to all database partition servers.
2273
+ **
2274
+ ** Authorization
2275
+ **
2276
+ ** One of the following:
2277
+ ** - sysadm or dbadm authority
2278
+ ** - BINDADD privilege if a package does not exist and one of:
2279
+ ** -- IMPLICIT_SCHEMA authority on the database if the schema name
2280
+ ** of the package does not exist
2281
+ ** -- CREATEIN privilege on the schema if the schema name of the
2282
+ ** package exists
2283
+ ** - ALTERIN privilege on the schema if the package exists
2284
+ ** - BIND privilege on the package if it exists.
2285
+ **
2286
+ ** The user also needs all privileges required to compile any static SQL
2287
+ ** statements in the application. Privileges granted to groups are not
2288
+ ** used for authorization checking of static statements. If the user
2289
+ ** has sysadm authority, but not explicit privileges to complete the
2290
+ ** bind, the database manager grants explicit dbadm authority
2291
+ ** automatically.
2292
+ **
2293
+ ** Required connection
2294
+ **
2295
+ ** Database
2296
+ **
2297
+ ** API include file
2298
+ **
2299
+ ** sql.h
2300
+ **
2301
+ ** sqlaprep API parameters
2302
+ **
2303
+ ** pProgramName
2304
+ ** Input. A string containing the name of the application to be precompiled. Use
2305
+ ** the following extensions:
2306
+ ** - .sqb - for COBOL applications
2307
+ ** - .sqc - for C applications
2308
+ ** - .sqC - for UNIX C++ applications
2309
+ ** - .sqf - for FORTRAN applications
2310
+ ** - .sqx - for C++ applications
2311
+ **
2312
+ ** When the TARGET option is used, the input file name extension does not have
2313
+ ** to be from this predefined list.
2314
+ **
2315
+ ** The preferred extension for C++ applications containing embedded SQL on UNIX
2316
+ ** based systems is sqC; however, the sqx convention, which was invented for
2317
+ ** systems that are not case sensitive, is tolerated by UNIX based systems.
2318
+ **
2319
+ ** pMsgFileName
2320
+ ** Input. A string containing the destination for error, warning, and
2321
+ ** informational messages. Can be the path and the name of an operating
2322
+ ** system file, or a standard device. If a file already exists, it is
2323
+ ** overwritten. If it does not exist, a file is created.
2324
+ **
2325
+ ** pPrepOptions
2326
+ ** Input. A structure used to pass precompile options to the API. For more
2327
+ ** information about this structure, see SQLOPT.
2328
+ **
2329
+ ** pSqlca
2330
+ ** Output. A pointer to the sqlca structure.
2331
+ **
2332
+ ** Usage notes
2333
+ **
2334
+ ** A modified source file is produced, which contains host language
2335
+ ** equivalents to the SQL statements. By default, a package is created
2336
+ ** in the database to which a connection has been established. The name
2337
+ ** of the package is the same as the program file name (minus the
2338
+ ** extension and folded to uppercase), up to a maximum of 8 characters.
2339
+ **
2340
+ ** Following connection to a database, sqlaprep executes under the
2341
+ ** transaction that was started. PRECOMPILE PROGRAM then issues a COMMIT
2342
+ ** or a ROLLBACK operation to terminate the current transaction and start
2343
+ ** another one.
2344
+ **
2345
+ ** Precompiling stops if a fatal error or more than 100 errors occur. If a fatal
2346
+ ** error does occur, PRECOMPILE PROGRAM stops precompiling, attempts to
2347
+ ** close all files, and discards the package.
2348
+ **
2349
+ ** The Precompile option types and values are defined in sql.h.
2350
+ **
2351
+ ** REXX API syntax
2352
+ **
2353
+ ** This API can be called from REXX through the SQLDB2 interface.
2354
+ *******************************************************************************/
2355
+ SQL_API_RC SQL_API_FN /* Precompile Program */
2356
+ sqlaprep (
2357
+ _SQLOLDCHAR * pProgramName, /* source file name */
2358
+ _SQLOLDCHAR * pMsgFileName, /* message file name */
2359
+ struct sqlopt * pPrepOptions, /* precompile options */
2360
+ struct sqlca * pSqlca); /* SQLCA */
2361
+
2362
+ /* Generic Interfaces to the Binder and Precompiler */
2363
+
2364
+ /******************************************************************************
2365
+ ** sqlgbndx API
2366
+ ** sqlgbndx API-specific parameters
2367
+ **
2368
+ ** pMsgFileName
2369
+ ** Input. A string containing the destination for error, warning, and
2370
+ ** informational messages. Can be the path and the name of an operating
2371
+ ** system file, or a standard device. If a file already exists, it is
2372
+ ** overwritten. If it does not exist, a file is created.
2373
+ **
2374
+ ** BindFileNameLen
2375
+ ** Input. Length in bytes of the pBindFileName parameter.
2376
+ *******************************************************************************/
2377
+ SQL_API_RC SQL_API_FN /* Bind */
2378
+ sqlgbndx (
2379
+ unsigned short MsgFileNameLen, /* message file name length */
2380
+ unsigned short BindFileNameLen, /* bind file name length */
2381
+ struct sqlca * pSqlca, /* SQLCA */
2382
+ struct sqlopt * pBindOptions, /* binder options */
2383
+ _SQLOLDCHAR * pMsgFileName, /* message file */
2384
+ _SQLOLDCHAR * pBindFileName); /* bind file name */
2385
+
2386
+ /******************************************************************************
2387
+ ** sqlgrbnd API
2388
+ ** sqlgrbnd API-specific parameters
2389
+ **
2390
+ ** PackageNameLen
2391
+ ** Input. Length in bytes of the pPackageName parameter.
2392
+ *******************************************************************************/
2393
+ SQL_API_RC SQL_API_FN /* Rebind */
2394
+ sqlgrbnd (
2395
+ unsigned short PackageNameLen, /* package name length */
2396
+ char * pPackageName, /* package name */
2397
+ struct sqlca * pSqlca, /* SQLCA */
2398
+ struct sqlopt * pRebindOptions); /* rebind options */
2399
+
2400
+ /******************************************************************************
2401
+ ** sqlgprep API
2402
+ ** sqlgprep API-specific parameters
2403
+ **
2404
+ ** MsgFileNameLen
2405
+ ** Input. Length in bytes of the pMsgFileName parameter.
2406
+ **
2407
+ ** ProgramNameLen
2408
+ ** Input. Length in bytes of the pProgramName parameter.
2409
+ *******************************************************************************/
2410
+ SQL_API_RC SQL_API_FN /* Precompile Program */
2411
+ sqlgprep (
2412
+ unsigned short MsgFileNameLen, /* message file name length */
2413
+ unsigned short ProgramNameLen, /* source file name length */
2414
+ struct sqlca * pSqlca, /* SQLCA */
2415
+ struct sqlopt * pPrepOptions, /* precompile options */
2416
+ _SQLOLDCHAR * pMsgFileName, /* message file name */
2417
+ _SQLOLDCHAR * pProgramName); /* source file name */
2418
+
2419
+ /* Application Context apis */
2420
+
2421
+
2422
+ #define SQL_CTX_ORIGINAL 0 /* serial access */
2423
+ #define SQL_CTX_MULTI_MANUAL 1 /* concurrent access */
2424
+ #define SQL_CTX_TRUSTED_ROUTINE 2 /* trusted routine (internal) */
2425
+ /******************************************************************************
2426
+ ** sqleSetTypeCtx API
2427
+ ** Sets the application context type. This API should be the first database API
2428
+ ** called inside an application.
2429
+ **
2430
+ ** Scope
2431
+ **
2432
+ ** The scope of this API is limited to the immediate process.
2433
+ **
2434
+ ** Authorization
2435
+ **
2436
+ ** None
2437
+ **
2438
+ ** Required connection
2439
+ **
2440
+ ** None
2441
+ **
2442
+ ** API include file
2443
+ **
2444
+ ** sql.h
2445
+ **
2446
+ ** sqleSetTypeCtx API parameters
2447
+ **
2448
+ ** lOptions
2449
+ ** Input. Valid values are:
2450
+ **
2451
+ ** - SQL_CTX_ORIGINAL
2452
+ ** All threads will use the same context, and concurrent access will be blocked.
2453
+ ** This is the default if none of these APIs is called.
2454
+ **
2455
+ ** - SQL_CTX_MULTI_MANUAL
2456
+ ** All threads will use separate contexts, and it is up to the application to
2457
+ ** manage the context for each thread. See
2458
+ ** - sqleBeginCtx API
2459
+ ** - sqleAttachToCtx API
2460
+ ** - sqleDetachFromCtx API
2461
+ ** - sqleEndCtx API
2462
+ **
2463
+ ** The following restrictions/changes apply when this option is used:
2464
+ ** - When termination is normal, automatic COMMIT at process termination is
2465
+ ** disabled. All outstanding transactions are rolled back, and all COMMITs must
2466
+ ** be done explicitly.
2467
+ ** - sqleintr API interrupts all contexts. To interrupt a specific context, use
2468
+ ** sqleInterruptCtx.
2469
+ **
2470
+ ** Usage notes
2471
+ **
2472
+ ** This API must be called before any other database call, and only the
2473
+ ** first call is effective.
2474
+ *******************************************************************************/
2475
+ SQL_API_RC SQL_API_FN /* Set Application Context */
2476
+ sqleSetTypeCtx (
2477
+ sqlint32 lOptions); /* options */
2478
+
2479
+
2480
+ #define SQL_CTX_BEGIN_ALL 0 /* create & attach */
2481
+ #define SQL_CTX_CREATE_ONLY 1 /* create only */
2482
+ /******************************************************************************
2483
+ ** sqleBeginCtx API
2484
+ ** Creates an application context, or creates and then attaches to an
2485
+ ** application context. More than one application context can be
2486
+ ** created. Each context has its own commit scope. Different threads
2487
+ ** can attach to different contexts (see the sqleAttachToCtx API).
2488
+ ** Any database API calls made by such threads will not be serialized
2489
+ ** with one another.
2490
+ **
2491
+ ** Scope
2492
+ **
2493
+ ** The scope of this API is limited to the immediate process.
2494
+ **
2495
+ ** Authorization
2496
+ **
2497
+ ** None
2498
+ **
2499
+ ** Required connection
2500
+ **
2501
+ ** None
2502
+ **
2503
+ ** API include file
2504
+ **
2505
+ ** sql.h
2506
+ **
2507
+ ** sqleBeginCtx API parameters
2508
+ **
2509
+ ** ppCtx
2510
+ ** Output. A data area allocated out of private memory for the storage
2511
+ ** of context information.
2512
+ **
2513
+ ** lOptions
2514
+ ** Input. Valid values are:
2515
+ ** - SQL_CTX_CREATE_ONLY
2516
+ ** The context memory will be allocated, but there will be no attachment.
2517
+ ** - SQL_CTX_BEGIN_ALL
2518
+ ** The context memory will be allocated, and then a call to sqleAttachToCtx will
2519
+ ** be made for the current thread. If this option is used, the ppCtx
2520
+ ** parameter can be NULL. If the thread is already attached to a context,
2521
+ ** the call will fail.
2522
+ **
2523
+ ** reserved
2524
+ ** Reserved for future use. Must be set to NULL.
2525
+ **
2526
+ ** pSqlca
2527
+ ** Output. A pointer to the sqlca structure.
2528
+ *******************************************************************************/
2529
+ SQL_API_RC SQL_API_FN /* Create Application Context */
2530
+ sqleBeginCtx (
2531
+ void ** ppCtx, /* pointer to a pointer to ctx */
2532
+ sqlint32 lOptions, /* lOptions */
2533
+ void * reserved, /* reserved */
2534
+ struct sqlca * pSqlca); /* SQLCA */
2535
+
2536
+
2537
+ #define SQL_CTX_END_ALL 0 /* detach & free */
2538
+ #define SQL_CTX_FREE_ONLY 1 /* free only */
2539
+ /******************************************************************************
2540
+ ** sqleEndCtx API
2541
+ ** Frees all memory associated with a given context.
2542
+ **
2543
+ ** Scope
2544
+ **
2545
+ ** The scope of this API is limited to the immediate process.
2546
+ **
2547
+ ** Authorization
2548
+ **
2549
+ ** None
2550
+ **
2551
+ ** Required connection
2552
+ **
2553
+ ** None
2554
+ **
2555
+ ** API include file
2556
+ **
2557
+ ** sql.h
2558
+ **
2559
+ ** sqleEndCtx API parameters
2560
+ **
2561
+ ** ppCtx
2562
+ ** Output. A data area in private memory (used for the storage of context
2563
+ ** information) that is freed.
2564
+ **
2565
+ ** lOptions
2566
+ ** Input. Valid values are:
2567
+ ** - SQL_CTX_FREE_ONLY
2568
+ ** The context memory will be freed only if a prior detach has been done.
2569
+ ** Note:
2570
+ ** pCtx must be a valid context previously allocated by sqleBeginCtx.
2571
+ ** - SQL_CTX_END_ALL
2572
+ ** If necessary, a call to sqleDetachFromCtx will be made before the memory is
2573
+ ** freed.
2574
+ ** Note:
2575
+ ** A detach will be done even if the context is still in use. If this option is
2576
+ ** used, the ppCtx parameter can be NULL, but if passed, it must be a valid
2577
+ ** context previously allocated by sqleBeginCtx. A call to
2578
+ ** sqleGetCurrentCtx will be made, and the current context freed from there.
2579
+ **
2580
+ ** reserved
2581
+ ** Reserved for future use. Must be set to NULL.
2582
+ **
2583
+ ** pSqlca
2584
+ ** Output. A pointer to the sqlca structure.
2585
+ **
2586
+ ** Usage notes
2587
+ **
2588
+ ** If a database connection exists, or the context has been attached by another
2589
+ ** thread, this call will fail.
2590
+ ** Note:
2591
+ ** If a context calls an API that establishes an instance attachment
2592
+ ** (for example, db2CfgGet, it is necessary to detach from the instance
2593
+ ** using sqledtin before calling sqleEndCtx.
2594
+ *******************************************************************************/
2595
+ SQL_API_RC SQL_API_FN /* Destroy Application Context */
2596
+ sqleEndCtx (
2597
+ void ** ppCtx, /* pointer to a pointer to ctx */
2598
+ sqlint32 lOptions, /* lOptions */
2599
+ void * reserved, /* reserved */
2600
+ struct sqlca * pSqlca); /* SQLCA */
2601
+
2602
+
2603
+ /******************************************************************************
2604
+ ** sqleAttachToCtx API
2605
+ ** Makes the current thread use a specified context. All subsequent
2606
+ ** database calls made on this thread will use this context. If more
2607
+ ** than one thread is attached to a given context, access is serialized
2608
+ ** for these threads, and they share a commit scope.
2609
+ **
2610
+ ** Scope
2611
+ **
2612
+ ** The scope of this API is limited to the immediate process.
2613
+ **
2614
+ ** Authorization
2615
+ **
2616
+ ** None
2617
+ **
2618
+ ** Required connection
2619
+ **
2620
+ ** None
2621
+ **
2622
+ ** API include file
2623
+ **
2624
+ ** sql.h
2625
+ **
2626
+ ** sqleAttachToCtx API parameters
2627
+ **
2628
+ ** pCtx
2629
+ ** Input. A valid context previously allocated by sqleBeginCtx.
2630
+ **
2631
+ ** reserved
2632
+ ** Reserved for future use. Must be set to NULL.
2633
+ **
2634
+ ** pSqlca
2635
+ ** Output. A pointer to the sqlca structure.
2636
+ *******************************************************************************/
2637
+ SQL_API_RC SQL_API_FN /* Attach to Application Context */
2638
+ sqleAttachToCtx (
2639
+ void * pCtx, /* pointer to ctx */
2640
+ void * reserved, /* reserved */
2641
+ struct sqlca * pSqlca); /* SQLCA */
2642
+
2643
+
2644
+ /******************************************************************************
2645
+ ** sqleDetachFromCtx API
2646
+ ** Detaches the context being used by the current thread. The context will be
2647
+ ** detached only if an attach to that context has previously been made.
2648
+ **
2649
+ ** Scope
2650
+ **
2651
+ ** The scope of this API is limited to the immediate process.
2652
+ **
2653
+ ** Authorization
2654
+ **
2655
+ ** None
2656
+ **
2657
+ ** Required connection
2658
+ **
2659
+ ** None
2660
+ **
2661
+ ** API include file
2662
+ **
2663
+ ** sql.h
2664
+ **
2665
+ ** sqleDetachFromCtx API parameters
2666
+ **
2667
+ ** pCtx
2668
+ ** Input. A valid context previously allocated by sqleBeginCtx.
2669
+ **
2670
+ ** reserved
2671
+ ** Reserved for future use. Must be set to NULL.
2672
+ **
2673
+ ** pSqlca
2674
+ ** Output. A pointer to the sqlca structure.
2675
+ *******************************************************************************/
2676
+ SQL_API_RC SQL_API_FN /* Detach Application Context */
2677
+ sqleDetachFromCtx (
2678
+ void * pCtx, /* pointer to ctx */
2679
+ void * reserved, /* reserved */
2680
+ struct sqlca * pSqlca); /* SQLCA */
2681
+
2682
+
2683
+ /******************************************************************************
2684
+ ** sqleGetCurrentCtx API
2685
+ ** Returns the current context associated with a thread.
2686
+ **
2687
+ ** Scope
2688
+ **
2689
+ ** The scope of this API is limited to the immediate process.
2690
+ **
2691
+ ** Authorization
2692
+ **
2693
+ ** None
2694
+ **
2695
+ ** Required connection
2696
+ **
2697
+ ** None
2698
+ **
2699
+ ** API include file
2700
+ **
2701
+ ** sql.h
2702
+ **
2703
+ ** sqleGetCurrentCtx API parameters
2704
+ **
2705
+ ** ppCtx
2706
+ ** Output. A data area allocated out of private memory for the storage
2707
+ ** of context information.
2708
+ **
2709
+ ** reserved
2710
+ ** Reserved for future use. Must be set to NULL.
2711
+ **
2712
+ ** pSqlca
2713
+ ** Output. A pointer to the sqlca structure.
2714
+ *******************************************************************************/
2715
+ SQL_API_RC SQL_API_FN /* Return Application Context */
2716
+ sqleGetCurrentCtx (
2717
+ void ** ppCtx, /* pointer to a pointer to ctx */
2718
+ void * reserved, /* reserved */
2719
+ struct sqlca * pSqlca); /* SQLCA */
2720
+
2721
+
2722
+ /******************************************************************************
2723
+ ** sqleInterruptCtx API
2724
+ ** Interrupts the specified context.
2725
+ **
2726
+ ** Scope
2727
+ **
2728
+ ** The scope of this API is limited to the immediate process.
2729
+ **
2730
+ ** Authorization
2731
+ **
2732
+ ** None
2733
+ **
2734
+ ** Required connection
2735
+ **
2736
+ ** Database
2737
+ **
2738
+ ** API include file
2739
+ **
2740
+ ** sql.h
2741
+ **
2742
+ ** sqleInterruptCtx API parameters
2743
+ **
2744
+ ** pCtx
2745
+ ** Input. A valid context previously allocated by sqleBeginCtx.
2746
+ **
2747
+ ** reserved
2748
+ ** Reserved for future use. Must be set to NULL.
2749
+ **
2750
+ ** pSqlca
2751
+ ** Output. A pointer to the sqlca structure.
2752
+ **
2753
+ ** Usage notes
2754
+ **
2755
+ ** During processing, this API:
2756
+ ** - Switches to the context that has been passed in
2757
+ ** - Sends an interrupt
2758
+ ** - Switches to the original context
2759
+ ** - Exits.
2760
+ *******************************************************************************/
2761
+ SQL_API_RC SQL_API_FN /* Interrupt Context */
2762
+ sqleInterruptCtx (
2763
+ void * pCtx, /* pointer to ctx */
2764
+ void * reserved, /* reserved */
2765
+ struct sqlca * pSqlca); /* SQLCA */
2766
+
2767
+
2768
+ /******************************************************************************
2769
+ ** Error/SQLSTATE Message Retrieval Interface Parameters/Return Codes
2770
+ *******************************************************************************/
2771
+
2772
+ /* Get Error Message Macro */
2773
+ #define sqlaintp(msgbuf,bufsize,linesize,sqlcaptr) \
2774
+ sqlaintp_api(msgbuf,bufsize,linesize, \
2775
+ (char *)"db2sql.mo", sqlcaptr)
2776
+ /******************************************************************************
2777
+ ** sqlaintp API
2778
+ ** Retrieves the message associated with an error condition specified by the
2779
+ ** sqlcode field of the sqlca structure.
2780
+ **
2781
+ ** Authorization
2782
+ **
2783
+ ** None
2784
+ **
2785
+ ** Required connection
2786
+ **
2787
+ ** None
2788
+ **
2789
+ ** API include file
2790
+ **
2791
+ ** sql.h
2792
+ **
2793
+ ** sqlaintp API parameters
2794
+ **
2795
+ ** pBuffer
2796
+ ** Output. A pointer to a string buffer where the message text is placed. If the
2797
+ ** message must be truncated to fit in the buffer, the truncation allows for the
2798
+ ** null string terminator character.
2799
+ **
2800
+ ** BufferSize
2801
+ ** Input. Size, in bytes, of a string buffer to hold the retrieved message text.
2802
+ **
2803
+ ** LineWidth
2804
+ ** Input. The maximum line width for each line of message text. Lines are broken
2805
+ ** on word boundaries. A value of zero indicates that the message text
2806
+ ** is returned without line breaks.
2807
+ **
2808
+ ** pSqlca
2809
+ ** Output. A pointer to the sqlca structure.
2810
+ **
2811
+ ** Usage notes
2812
+ **
2813
+ ** One message is returned per call.
2814
+ **
2815
+ ** A new line (line feed, LF, or carriage return/line feed, CR/LF) sequence is
2816
+ ** placed at the end of each message.
2817
+ **
2818
+ ** If a positive line width is specified, new line sequences are inserted
2819
+ ** between words so that the lines do not exceed the line width.
2820
+ **
2821
+ ** If a word is longer than a line width, the line is filled with as many
2822
+ ** characters as will fit, a new line is inserted, and the remaining characters
2823
+ ** are placed on the next line.
2824
+ **
2825
+ ** In a multi-threaded application, sqlaintp must be attached to a
2826
+ ** valid context; otherwise, the message text for SQLCODE - 1445 cannot
2827
+ ** be obtained
2828
+ **
2829
+ ** Return codes
2830
+ **
2831
+ ** Code
2832
+ **
2833
+ ** Message
2834
+ **
2835
+ ** +i
2836
+ ** Positive integer indicating the number of bytes in the formatted message. If
2837
+ ** this is greater than the buffer size input by the caller, the message is
2838
+ ** truncated.
2839
+ **
2840
+ ** -1
2841
+ ** Insufficient memory available for message formatting services to
2842
+ ** function. The requested message is not returned.
2843
+ **
2844
+ ** -2
2845
+ ** No error. The sqlca did not contain an error code (SQLCODE = 0).
2846
+ **
2847
+ ** -3
2848
+ ** Message file inaccessible or incorrect.
2849
+ **
2850
+ ** -4
2851
+ ** Line width is less than zero.
2852
+ **
2853
+ ** -5
2854
+ ** Invalid sqlca, bad buffer address, or bad buffer length.
2855
+ **
2856
+ ** If the return code is -1 or -3, the message buffer will contain additional
2857
+ ** information about the problem.
2858
+ **
2859
+ ** REXX API syntax
2860
+ **
2861
+ ** GET MESSAGE INTO :msg [LINEWIDTH width]
2862
+ **
2863
+ ** REXX API parameters
2864
+ **
2865
+ ** msg
2866
+ ** REXX variable into which the text message is placed.
2867
+ **
2868
+ ** width
2869
+ ** Maximum line width for each line in the text message. The line is broken on
2870
+ ** word boundaries. If width is not given or set to 0, the message text returns
2871
+ ** without line breaks.
2872
+ *******************************************************************************/
2873
+ SQL_API_RC SQL_API_FN /* Get Error Message */
2874
+ sqlaintp_api (
2875
+ char * pBuffer, /* buffer for message text */
2876
+ short BufferSize, /* buffer size */
2877
+ short LineWidth, /* line width */
2878
+ const char * pMsgFileName, /* message file */
2879
+ struct sqlca * pSqlca); /* SQLCA */
2880
+
2881
+ /* Generic Interface to Error Message Retrieval */
2882
+ /******************************************************************************
2883
+ ** sqlgintp API
2884
+ *******************************************************************************/
2885
+ SQL_API_RC SQL_API_FN /* Get Error Message */
2886
+ sqlgintp (
2887
+ short BufferSize, /* buffer size */
2888
+ short LineWidth, /* line width */
2889
+ struct sqlca * pSqlca, /* SQLCA */
2890
+ _SQLOLDCHAR * pBuffer); /* buffer */
2891
+
2892
+ /******************************************************************************
2893
+ ** sqlogstt API
2894
+ ** Retrieves the message text associated with an SQLSTATE value.
2895
+ **
2896
+ ** Authorization
2897
+ **
2898
+ ** None
2899
+ **
2900
+ ** Required connection
2901
+ **
2902
+ ** None
2903
+ **
2904
+ ** API include file
2905
+ **
2906
+ ** sql.h
2907
+ **
2908
+ ** sqlogstt API parameters
2909
+ **
2910
+ ** pBuffer
2911
+ ** Output. A pointer to a string buffer where the message text is to be
2912
+ ** placed. If the message must be truncated to fit in the buffer, the
2913
+ ** truncation allows for the null string terminator character.
2914
+ **
2915
+ ** BufferSize
2916
+ ** Input. Size, in bytes, of a string buffer to hold the retrieved message text.
2917
+ **
2918
+ ** LineWidth
2919
+ ** Input. The maximum line width for each line of message text. Lines are broken
2920
+ ** on word boundaries. A value of zero indicates that the message text is
2921
+ ** returned without line breaks.
2922
+ **
2923
+ ** pSqlstate
2924
+ ** Input. A string containing the SQLSTATE for which the message text is to be
2925
+ ** retrieved. This field is alphanumeric and must be either five-digit (specific
2926
+ ** SQLSTATE) or two-digit (SQLSTATE class, first two digits of an
2927
+ ** SQLSTATE). This field does not need to be NULL-terminated if 5 digits
2928
+ ** are being passed in, but must be NULL-terminated if 2 digits are being
2929
+ ** passed.
2930
+ **
2931
+ ** Usage notes
2932
+ **
2933
+ ** One message is returned per call.
2934
+ **
2935
+ ** A LF/NULL sequence is placed at the end of each message.
2936
+ **
2937
+ ** If a positive line width is specified, LF/NULL sequences are inserted between
2938
+ ** words so that the lines do not exceed the line width.
2939
+ **
2940
+ ** If a word is longer than a line width, the line is filled with as many
2941
+ ** characters as will fit, a LF/NULL is inserted, and the remaining
2942
+ ** characters are placed on the next line.
2943
+ **
2944
+ ** Return codes
2945
+ **
2946
+ ** Code
2947
+ **
2948
+ ** Message
2949
+ **
2950
+ ** +i
2951
+ ** Positive integer indicating the number of bytes in the formatted message. If
2952
+ ** this is greater than the buffer size input by the caller, the message is
2953
+ ** truncated.
2954
+ **
2955
+ ** -1
2956
+ ** Insufficient memory available for message formatting services to
2957
+ ** function. The requested message is not returned.
2958
+ **
2959
+ ** -2
2960
+ ** The SQLSTATE is in the wrong format. It must be alphanumeric and be
2961
+ ** either 2 or 5 digits in length.
2962
+ **
2963
+ ** -3
2964
+ ** Message file inaccessible or incorrect.
2965
+ **
2966
+ ** -4
2967
+ ** Line width is less than zero.
2968
+ **
2969
+ ** -5
2970
+ ** Invalid sqlca, bad buffer address, or bad buffer length.
2971
+ **
2972
+ ** If the return code is -1 or -3, the message buffer will contain further
2973
+ ** information about the problem.
2974
+ **
2975
+ ** REXX API syntax
2976
+ **
2977
+ ** GET MESSAGE FOR SQLSTATE sqlstate INTO :msg [LINEWIDTH width]
2978
+ **
2979
+ ** REXX API parameters
2980
+ **
2981
+ ** sqlstate
2982
+ ** The SQLSTATE for which the message text is to be retrieved.
2983
+ **
2984
+ ** msg
2985
+ ** REXX variable into which the message is placed.
2986
+ **
2987
+ ** width
2988
+ ** Maximum line width for each line of the message text. The line is broken on
2989
+ ** word boundaries. If a value is not specified, or this parameter is set to 0,
2990
+ ** the message text returns without line breaks.
2991
+ *******************************************************************************/
2992
+ SQL_API_RC SQL_API_FN /* Sqlstate Message Retrieval */
2993
+ sqlogstt (
2994
+ char * pBuffer, /* buffer for message text */
2995
+ short BufferSize, /* buffer size */
2996
+ short LineWidth, /* line width */
2997
+ char * pSqlstate); /* sqlstate */
2998
+
2999
+ /* Generic Interface to SQLSTATE Message Retrieval */
3000
+ /******************************************************************************
3001
+ ** sqlggstt API
3002
+ *******************************************************************************/
3003
+ SQL_API_RC SQL_API_FN /* Sqlstate Message Retrieval */
3004
+ sqlggstt (
3005
+ short BufferSize, /* buffer size */
3006
+ short LineWidth, /* line width */
3007
+ char * pSqlstate, /* sqlstate */
3008
+ char * pBuffer); /* buffer */
3009
+
3010
+ /* Return Codes for sqlaintp/sqlogstt */
3011
+ #define SQLA_ERR_BADCC -1 /* insufficient memory for msg file */
3012
+ #define SQLA_ERR_NOCOD -2 /* no error code in SQLCA */
3013
+ #define SQLA_ERR_NOMSG -3 /* message file inaccessible or */
3014
+ /* incorrect */
3015
+ #define SQLA_ERR_BADLL -4 /* specified line length negative */
3016
+ #define SQLA_ERR_BADCA -5 /* invalid sqlca/buffer addr/length */
3017
+
3018
+ /* Administrative/Database Authorizations values used to process the return */
3019
+ /* from Get Administrative Authorizations function. Each value represents */
3020
+ /* the index in the authorizations array. */
3021
+ #define SQL_DBAUTH_SYSADM 0 /* SYSADM Authority */
3022
+ #define SQL_DBAUTH_DBADM 1 /* DBADM Authority */
3023
+ #define SQL_DBAUTH_CREATETAB 2 /* CREATETAB Privilege */
3024
+ #define SQL_DBAUTH_BINDADD 3 /* BINDADD Privilege */
3025
+ #define SQL_DBAUTH_CONNECT 4 /* CONNECT Privilege */
3026
+ #define SQL_DBAUTH_CREATE_NOT_FENC 5 /* CREATE_NOT_FENCED Privilege */
3027
+ #define SQL_DBAUTH_SYSCTRL 6 /* SYSCTRL Authority */
3028
+ #define SQL_DBAUTH_SYSMAINT 7 /* SYSMAINT Authority */
3029
+ #define SQL_DBAUTH_IMPLICIT_SCHEMA 8 /* IMPLICIT_SCHEMA Privilege */
3030
+ #define SQL_DBAUTH_LOAD 9 /* LOAD Privilege */
3031
+ #define SQL_DBAUTH_CREATE_EXT_RT 10 /* CREATE_EXTERNAL_ROUTINE Privilege */
3032
+ #define SQL_DBAUTH_LIBADM 11 /* LIBRARYADM Privilege */
3033
+ #define SQL_DBAUTH_QUIESCE_CONN 12 /* QUIESCE_CONNECT Privilege */
3034
+ #define SQL_DBAUTH_SECADM 13 /* SECURITYADM Privilege */
3035
+ #define SQL_DBAUTH_SYSQUIESCE 14 /* SYSQUIESCE Authority */
3036
+ #define SQL_DBAUTH_SYSMON 15 /* SYSMON Authority */
3037
+ #define SQL_DBAUTH_SQLADM 16 /* SQLADM Authority */
3038
+ #define SQL_DBAUTH_WLMADM 17 /* WLMADM Authority */
3039
+ #define SQL_DBAUTH_EXPLAIN 18 /* EXPLAIN Authority */
3040
+ #define SQL_DBAUTH_DATAACCESS 19 /* DATAACCESS Authority */
3041
+ #define SQL_DBAUTH_ACCESSCTRL 20 /* ACCESSCTRL Authority */
3042
+ #define SQL_DBAUTH_CREATE_SECURE_OBJ 21 /* CREATE_SECURE_OBJECT Authority */
3043
+ #define SQL_DBAUTH_MAX 22 /* Max Number of Authorities */
3044
+
3045
+ /* Authority origin */
3046
+ #define SQL_AUTH_ORIGIN_USER 0x1 /* USER direct */
3047
+ #define SQL_AUTH_ORIGIN_GROUP 0x2 /* GROUP indirect */
3048
+ #define SQL_AUTH_ORIGIN_ROLE 0x4 /* ROLE indirect */
3049
+ #define SQL_AUTH_ORIGIN_PUBLIC 0x8 /* PUBLIC indirect */
3050
+
3051
+ /* The following values marked as OBSOLETE will be deprecated in future */
3052
+ /* versions. They are valid for versions v9.1 and earlier. To retrieve the */
3053
+ /* database authorizations for a user, group, role or PUBLIC it is */
3054
+ /* recommended to use the new AUTH_LIST_AUTHORITIES_FOR_AUTHID table */
3055
+ /* function. The new database authority values defined above cannot be used */
3056
+ /* in conjunction with the old database authority values defined below or */
3057
+ /* with the old SQL GET AUTHORIZATION API (sqluadau()) */
3058
+
3059
+ /* OBSOLETE: Authorizations granted explicitly to user */
3060
+ #define SQL_SYSADM 0x1 /* SYSADM Authority */
3061
+ #define SQL_DBADM 0x2 /* DBADM Authority */
3062
+ #define SQL_CREATETAB 0x4 /* CREATETAB Privilege */
3063
+ #define SQL_BINDADD 0x8 /* BINDADD Privilege */
3064
+ #define SQL_CONNECT 0x10 /* CONNECT Privilege */
3065
+ #define SQL_CREATE_NOT_FENC 0x20 /* CREATE_NOT_FENCED Privilege */
3066
+ #define SQL_SYSCTRL 0x40 /* SYSCTRL Authority */
3067
+ #define SQL_SYSMAINT 0x80 /* SYSMAINT Authority */
3068
+ #define SQL_IMPLICIT_SCHEMA 0x10000 /* IMPLICIT_SCHEMA Privilege */
3069
+ #define SQL_LOAD 0x20000 /* LOAD Privilege */
3070
+ #define SQL_CREATE_EXT_RT 0x40000 /* CREATE_EXTERNAL_ROUTINE Privilege */
3071
+ #define SQL_LIBADM 0x80000 /* LIBRARYADM Privilege */
3072
+ #define SQL_QUIESCE_CONN 0x100000 /* QUIESCE_CONNECT Privilege */
3073
+ #define SQL_SECADM 0x200000 /* SECURITYADM Privilege */
3074
+ #define SQL_SYSQUIESCE 0x400000 /* SYSQUIESCE Authority */
3075
+ #define SQL_SYSMON 0x800000 /* SYSMON Authority */
3076
+
3077
+ /* OBSOLETE: Composite of authorizations granted explicitly to user,to */
3078
+ /* groups of which user is a member, and to PUBLIC */
3079
+ #define SQL_SYSADM_GRP 0x100
3080
+ #define SQL_DBADM_GRP 0x200
3081
+ #define SQL_CREATETAB_GRP 0x400
3082
+ #define SQL_BINDADD_GRP 0x800
3083
+ #define SQL_CONNECT_GRP 0x1000
3084
+ #define SQL_CREATE_NOT_FENC_GRP 0x2000
3085
+ #define SQL_SYSCTRL_GRP 0x4000
3086
+ #define SQL_SYSMAINT_GRP 0x8000
3087
+ #define SQL_IMPLICIT_SCHEMA_GRP 0x1000000
3088
+ #define SQL_LOAD_GRP 0x2000000
3089
+ #define SQL_CREATE_EXT_RT_GRP 0x4000000
3090
+ #define SQL_LIBADM_GRP 0x8000000
3091
+ #define SQL_QUIESCE_CONN_GRP 0x10000000
3092
+ #define SQL_SECADM_GRP 0x20000000
3093
+ #define SQL_SYSQUIESCE_GRP 0x40000000
3094
+ #define SQL_SYSMON_GRP 0x80000000
3095
+
3096
+ /* Table/View Authorizations/Dependencies Bit definitions in */
3097
+ /* SYSTABAUTH.TABAUTH and SYSPLANDEP.TABAUTH */
3098
+ #define SQL_TAB_CTL 0x1 /* Control Authority */
3099
+ #define SQL_TAB_ALT 0x2 /* Alter Privilege */
3100
+ #define SQL_TAB_DEL 0x4 /* Delete Privilege/Dependency */
3101
+ #define SQL_TAB_IDX 0x8 /* Index Privilege */
3102
+ #define SQL_TAB_INS 0x10 /* Insert Privilege/Dependency */
3103
+ #define SQL_TAB_SEL 0x20 /* Select Privilege/Dependency */
3104
+ #define SQL_TAB_UPD 0x40 /* Update Privilege/Dependency */
3105
+ #define SQL_TAB_REF 0x80 /* Reference Privilege */
3106
+ #define SQL_TAB_KEY 0x2000 /* Key Dependency */
3107
+ #define SQL_TAB_CAS 0x4000 /* Cascade Dependency */
3108
+ #define SQL_VAR_REA 0x1 /* Read Privilege */
3109
+ #define SQL_VAR_WRI 0x2 /* Write Privilege */
3110
+
3111
+ /* Bit definitions for SYSTABAUTH.TABAUTH indicating the specified table or */
3112
+ /* view privilege is grantable. */
3113
+ #define SQL_TAB_ALT_G 0x200 /* Alter Privilege Grantable */
3114
+ #define SQL_TAB_DEL_G 0x400 /* Delete Privilege Grantable */
3115
+ #define SQL_TAB_IDX_G 0x800 /* Index Privilege Grantable */
3116
+ #define SQL_TAB_INS_G 0x1000 /* Insert Privilege Grantable */
3117
+ #define SQL_TAB_SEL_G 0x2000 /* Select Privilege Grantable */
3118
+ #define SQL_TAB_UPD_G 0x4000 /* Update Privilege Grantable */
3119
+ #define SQL_TAB_REF_G 0x8000 /* References Privilege Grantable */
3120
+ #define SQL_VAR_REA_G 0x100 /* Read Privilege Grantable */
3121
+ #define SQL_VAR_WRI_G 0x200 /* Write Privilege Grantable */
3122
+
3123
+ /* Definitions for application remote interface */
3124
+ #define SQLZ_DISCONNECT_PROC 1 /* Unload Progam */
3125
+ #define SQLZ_HOLD_PROC 2 /* Keep program loaded */
3126
+ /* The following functions and symbols are obsolete and may not be supported */
3127
+ /* in future releases. The obsolete functions are provided for backward */
3128
+ /* compatibility and exported from DB2API.LIB. All applications should be */
3129
+ /* migrated to use new APIs. */
3130
+ #define SQLA_RC_BAD_PASSWD -4 /* Invalid password */
3131
+ #define SQL_MAXSTMTS 32767 /* Maximum statements (see SQL */
3132
+ /* reference) */
3133
+ #define SQL_MAXVARS 32767 /* Maximum host variables per */
3134
+ /* precompile unit (see SQL */
3135
+ /* reference) */
3136
+ #define SQL_DYNAMICRULES_INVOKE SQL_DYNAMICRULES_INVOKERUN /* Dynamic SQL in */
3137
+ /* UDF or stored procedure will use */
3138
+ /* authid of invoker of UDF or stored */
3139
+ /* procedure */
3140
+ #define SQL_DYNAMICRULES_DEFINE SQL_DYNAMICRULES_DEFINERUN /* Dynamic SQL in */
3141
+ /* UDF or stored procedure will use */
3142
+ /* authid of definer of UDF or stored */
3143
+ /* procedure */
3144
+
3145
+ #ifdef __cplusplus
3146
+ }
3147
+ #endif
3148
+
3149
+ #endif /* SQL_H_SQL */