File: sqlext.h

package info (click to toggle)
libiodbc2 2.50.3-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 860 kB
  • ctags: 1,245
  • sloc: ansic: 8,060; sh: 6,664; makefile: 81
file content (1405 lines) | stat: -rw-r--r-- 34,779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
/*
 *  sqlext.h
 *
 *  $Id: sqlext.h,v 1.1 1999/06/25 03:02:44 source Exp $
 *
 *  ODBC defines (ext)
 *
 *  The iODBC driver manager.
 *  
 *  Copyright (C) 1995 by Ke Jin <kejin@empress.com> 
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
#ifndef	_SQLEXT_H
#define _SQLEXT_H

#ifndef _SQL_H
#include <sql.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
 *  Additional return codes
 */
#define SQL_STILL_EXECUTING 		2
#define SQL_NEED_DATA			99


/*
 *  SQL extended datatypes
 */
#define SQL_DATE			9
#define SQL_TIME			10
#define SQL_TIMESTAMP			11
#define SQL_LONGVARCHAR		 	(-1)
#define SQL_BINARY			(-2)
#define SQL_VARBINARY			(-3)
#define SQL_LONGVARBINARY		(-4)
#define SQL_BIGINT			(-5)
#define SQL_TINYINT 			(-6)
#define SQL_BIT 			(-7)

#define SQL_INTERVAL_YEAR		(-80)
#define SQL_INTERVAL_MONTH		(-81)
#define SQL_INTERVAL_YEAR_TO_MONTH	(-82)
#define SQL_INTERVAL_DAY		(-83)
#define SQL_INTERVAL_HOUR		(-84)
#define SQL_INTERVAL_MINUTE		(-85)
#define SQL_INTERVAL_SECOND		(-86)
#define SQL_INTERVAL_DAY_TO_HOUR	(-87)
#define SQL_INTERVAL_DAY_TO_MINUTE	(-88)
#define SQL_INTERVAL_DAY_TO_SECOND	(-89)
#define SQL_INTERVAL_HOUR_TO_MINUTE	(-90)
#define SQL_INTERVAL_HOUR_TO_SECOND	(-91)
#define SQL_INTERVAL_MINUTE_TO_SECOND	(-92)
#define SQL_UNICODE			(-95)
#define SQL_UNICODE_VARCHAR		(-96)
#define SQL_UNICODE_LONGVARCHAR		(-97)
#define SQL_UNICODE_CHAR		SQL_UNICODE

#define SQL_TYPE_DRIVER_START		SQL_INTERVAL_YEAR
#define SQL_TYPE_DRIVER_END		SQL_UNICODE_LONGVARCHAR

#define SQL_SIGNED_OFFSET		(-20)
#define SQL_UNSIGNED_OFFSET		(-22)


/*
 *  C datatype to SQL datatype mapping
 */
#define SQL_C_DATE			SQL_DATE
#define SQL_C_TIME			SQL_TIME
#define SQL_C_TIMESTAMP 		SQL_TIMESTAMP
#define SQL_C_BINARY			SQL_BINARY
#define SQL_C_BIT			SQL_BIT
#define SQL_C_TINYINT			SQL_TINYINT
#define SQL_C_SLONG 			SQL_C_LONG+SQL_SIGNED_OFFSET
#define SQL_C_SSHORT			SQL_C_SHORT+SQL_SIGNED_OFFSET
#define SQL_C_STINYINT			SQL_TINYINT+SQL_SIGNED_OFFSET
#define SQL_C_ULONG 			SQL_C_LONG+SQL_UNSIGNED_OFFSET
#define SQL_C_USHORT			SQL_C_SHORT+SQL_UNSIGNED_OFFSET
#define SQL_C_UTINYINT			SQL_TINYINT+SQL_UNSIGNED_OFFSET
#define SQL_C_BOOKMARK			SQL_C_ULONG


/*
 *  Extended data types override sql.h defined
 */
#undef	SQL_TYPE_MIN
#define SQL_TYPE_MIN		SQL_BIT
#define SQL_ALL_TYPES		0


/*
 * ----------------------------------------------------------------------
 *  Level 1 Functions
 * ----------------------------------------------------------------------
 */

/*
 *  SQLDriverConnect
 */
#define SQL_DRIVER_NOPROMPT 		0
#define SQL_DRIVER_COMPLETE 		1
#define SQL_DRIVER_PROMPT		2
#define SQL_DRIVER_COMPLETE_REQUIRED	3


/*
 *  SQLGetData
 */
#define SQL_NO_TOTAL			(-4)


/*
 *  SQLBindParameter
 */
#define SQL_DEFAULT_PARAM		(-5)
#define SQL_IGNORE			(-6)
#define SQL_LEN_DATA_AT_EXEC_OFFSET	(-100)
#define SQL_LEN_DATA_AT_EXEC(length) 	(-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)


/*
 *  SQLGetFunctions
 */
#define SQL_API_SQLALLOCCONNECT		1	/* Core Functions */
#define SQL_API_SQLALLOCENV		2
#define SQL_API_SQLALLOCSTMT		3
#define SQL_API_SQLBINDCOL		4
#define SQL_API_SQLCANCEL		5
#define SQL_API_SQLCOLATTRIBUTES	6
#define SQL_API_SQLCONNECT		7
#define SQL_API_SQLDESCRIBECOL		8
#define SQL_API_SQLDISCONNECT		9
#define SQL_API_SQLERROR		10
#define SQL_API_SQLEXECDIRECT		11
#define SQL_API_SQLEXECUTE		12
#define SQL_API_SQLFETCH		13
#define SQL_API_SQLFREECONNECT		14
#define SQL_API_SQLFREEENV		15
#define SQL_API_SQLFREESTMT		16
#define SQL_API_SQLGETCURSORNAME	17
#define SQL_API_SQLNUMRESULTCOLS	18
#define SQL_API_SQLPREPARE		19
#define SQL_API_SQLROWCOUNT		20
#define SQL_API_SQLSETCURSORNAME	21
#define SQL_API_SQLSETPARAM		22
#define SQL_API_SQLTRANSACT		23

#define SQL_NUM_FUNCTIONS		23

#define SQL_EXT_API_START		40

#define SQL_API_SQLCOLUMNS		40	/* Level 1 Functions */
#define SQL_API_SQLDRIVERCONNECT	41
#define SQL_API_SQLGETCONNECTOPTION 	42
#define SQL_API_SQLGETDATA		43
#define SQL_API_SQLGETFUNCTIONS		44
#define SQL_API_SQLGETINFO		45
#define SQL_API_SQLGETSTMTOPTION	46
#define SQL_API_SQLGETTYPEINFO		47
#define SQL_API_SQLPARAMDATA		48
#define SQL_API_SQLPUTDATA		49
#define SQL_API_SQLSETCONNECTOPTION 	50
#define SQL_API_SQLSETSTMTOPTION	51
#define SQL_API_SQLSPECIALCOLUMNS	52
#define SQL_API_SQLSTATISTICS		53
#define SQL_API_SQLTABLES		54

#define SQL_API_SQLBROWSECONNECT	55	/* Level 2 Functions */
#define SQL_API_SQLCOLUMNPRIVILEGES 	56
#define SQL_API_SQLDATASOURCES		57
#define SQL_API_SQLDESCRIBEPARAM	58
#define SQL_API_SQLEXTENDEDFETCH	59
#define SQL_API_SQLFOREIGNKEYS		60
#define SQL_API_SQLMORERESULTS		61
#define SQL_API_SQLNATIVESQL		62
#define SQL_API_SQLNUMPARAMS		63
#define SQL_API_SQLPARAMOPTIONS		64
#define SQL_API_SQLPRIMARYKEYS		65
#define SQL_API_SQLPROCEDURECOLUMNS 	66
#define SQL_API_SQLPROCEDURES		67
#define SQL_API_SQLSETPOS		68
#define SQL_API_SQLSETSCROLLOPTIONS 	69
#define SQL_API_SQLTABLEPRIVILEGES	70

#define SQL_API_SQLDRIVERS		71
#define SQL_API_SQLBINDPARAMETER	72
#define SQL_EXT_API_LAST		SQL_API_SQLBINDPARAMETER

#define SQL_API_ALL_FUNCTIONS		0

#define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)

#define SQL_API_LOADBYORDINAL		199


/*
 *  SQLGetInfo
 */
#define SQL_INFO_FIRST			0
#define SQL_ACTIVE_CONNECTIONS		0
#define SQL_ACTIVE_STATEMENTS		1
#define SQL_DATA_SOURCE_NAME		2
#define SQL_DRIVER_HDBC			3
#define SQL_DRIVER_HENV			4
#define SQL_DRIVER_HSTMT		5
#define SQL_DRIVER_NAME			6
#define SQL_DRIVER_VER			7
#define SQL_FETCH_DIRECTION		8
#define SQL_ODBC_API_CONFORMANCE	9
#define SQL_ODBC_VER			10
#define SQL_ROW_UPDATES			11
#define SQL_ODBC_SAG_CLI_CONFORMANCE	12
#define SQL_SERVER_NAME			13
#define SQL_SEARCH_PATTERN_ESCAPE	14
#define SQL_ODBC_SQL_CONFORMANCE	15
#define SQL_DBMS_NAME			17
#define SQL_DBMS_VER			18
#define SQL_ACCESSIBLE_TABLES		19
#define SQL_ACCESSIBLE_PROCEDURES	20
#define SQL_PROCEDURES			21
#define SQL_CONCAT_NULL_BEHAVIOR	22
#define SQL_CURSOR_COMMIT_BEHAVIOR	23
#define SQL_CURSOR_ROLLBACK_BEHAVIOR	24
#define SQL_DATA_SOURCE_READ_ONLY	25
#define SQL_DEFAULT_TXN_ISOLATION	26
#define SQL_EXPRESSIONS_IN_ORDERBY	27
#define SQL_IDENTIFIER_CASE		28
#define SQL_IDENTIFIER_QUOTE_CHAR	29
#define SQL_MAX_COLUMN_NAME_LEN		30
#define SQL_MAX_CURSOR_NAME_LEN		31
#define SQL_MAX_OWNER_NAME_LEN		32
#define SQL_MAX_PROCEDURE_NAME_LEN	33
#define SQL_MAX_QUALIFIER_NAME_LEN	34
#define SQL_MAX_TABLE_NAME_LEN		35
#define SQL_MULT_RESULT_SETS		36
#define SQL_MULTIPLE_ACTIVE_TXN		37
#define SQL_OUTER_JOINS			38
#define SQL_OWNER_TERM			39
#define SQL_PROCEDURE_TERM		40
#define SQL_QUALIFIER_NAME_SEPARATOR	41
#define SQL_QUALIFIER_TERM		42
#define SQL_SCROLL_CONCURRENCY		43
#define SQL_SCROLL_OPTIONS		44
#define SQL_TABLE_TERM			45
#define SQL_TXN_CAPABLE			46
#define SQL_USER_NAME			47
#define SQL_CONVERT_FUNCTIONS		48
#define SQL_NUMERIC_FUNCTIONS		49
#define SQL_STRING_FUNCTIONS		50
#define SQL_SYSTEM_FUNCTIONS		51
#define SQL_TIMEDATE_FUNCTIONS		52
#define SQL_CONVERT_BIGINT		53
#define SQL_CONVERT_BINARY		54
#define SQL_CONVERT_BIT			55
#define SQL_CONVERT_CHAR		56
#define SQL_CONVERT_DATE		57
#define SQL_CONVERT_DECIMAL		58
#define SQL_CONVERT_DOUBLE		59
#define SQL_CONVERT_FLOAT		60
#define SQL_CONVERT_INTEGER		61
#define SQL_CONVERT_LONGVARCHAR		62
#define SQL_CONVERT_NUMERIC		63
#define SQL_CONVERT_REAL		64
#define SQL_CONVERT_SMALLINT		65
#define SQL_CONVERT_TIME		66
#define SQL_CONVERT_TIMESTAMP		67
#define SQL_CONVERT_TINYINT		68
#define SQL_CONVERT_VARBINARY		69
#define SQL_CONVERT_VARCHAR		70
#define SQL_CONVERT_LONGVARBINARY	71
#define SQL_TXN_ISOLATION_OPTION	72
#define SQL_ODBC_SQL_OPT_IEF		73

/*
 *  ODBC SDK 1.0 Additions
 */
#define SQL_CORRELATION_NAME		74
#define SQL_NON_NULLABLE_COLUMNS	75

/*
 *  ODBC SDK 2.0 Additions
 */
#define SQL_DRIVER_HLIB 		76
#define SQL_DRIVER_ODBC_VER 		77
#define SQL_LOCK_TYPES			78
#define SQL_POS_OPERATIONS		79
#define SQL_POSITIONED_STATEMENTS	80
#define SQL_GETDATA_EXTENSIONS		81
#define SQL_BOOKMARK_PERSISTENCE	82
#define SQL_STATIC_SENSITIVITY		83
#define SQL_FILE_USAGE			84
#define SQL_NULL_COLLATION		85
#define SQL_ALTER_TABLE 		86
#define SQL_COLUMN_ALIAS		87
#define SQL_GROUP_BY			88
#define SQL_KEYWORDS			89
#define SQL_ORDER_BY_COLUMNS_IN_SELECT	90
#define SQL_OWNER_USAGE 		91
#define SQL_QUALIFIER_USAGE 		92
#define SQL_QUOTED_IDENTIFIER_CASE	93
#define SQL_SPECIAL_CHARACTERS		94
#define SQL_SUBQUERIES			95
#define SQL_UNION			96
#define SQL_MAX_COLUMNS_IN_GROUP_BY 	97
#define SQL_MAX_COLUMNS_IN_INDEX	98
#define SQL_MAX_COLUMNS_IN_ORDER_BY 	99
#define SQL_MAX_COLUMNS_IN_SELECT	100
#define SQL_MAX_COLUMNS_IN_TABLE	101
#define SQL_MAX_INDEX_SIZE		102
#define SQL_MAX_ROW_SIZE_INCLUDES_LONG	103
#define SQL_MAX_ROW_SIZE		104
#define SQL_MAX_STATEMENT_LEN		105
#define SQL_MAX_TABLES_IN_SELECT	106
#define SQL_MAX_USER_NAME_LEN		107
#define SQL_MAX_CHAR_LITERAL_LEN 	108
#define SQL_TIMEDATE_ADD_INTERVALS	109
#define SQL_TIMEDATE_DIFF_INTERVALS 	110
#define SQL_NEED_LONG_DATA_LEN		111
#define SQL_MAX_BINARY_LITERAL_LEN	112
#define SQL_LIKE_ESCAPE_CLAUSE		113
#define SQL_QUALIFIER_LOCATION		114

/*
 *  ODBC SDK 2.01 Additions
 */
#define SQL_OJ_CAPABILITIES 		65003	/* Temp value until ODBC 3.0 */

#define SQL_INFO_LAST			SQL_QUALIFIER_LOCATION
#define SQL_INFO_DRIVER_START		1000


/*
 *  SQL_CONVERT_* bitmask values
 */
#define SQL_CVT_CHAR			0x00000001L
#define SQL_CVT_NUMERIC 		0x00000002L
#define SQL_CVT_DECIMAL 		0x00000004L
#define SQL_CVT_INTEGER 		0x00000008L
#define SQL_CVT_SMALLINT		0x00000010L
#define SQL_CVT_FLOAT			0x00000020L
#define SQL_CVT_REAL			0x00000040L
#define SQL_CVT_DOUBLE			0x00000080L
#define SQL_CVT_VARCHAR 		0x00000100L
#define SQL_CVT_LONGVARCHAR 		0x00000200L
#define SQL_CVT_BINARY			0x00000400L
#define SQL_CVT_VARBINARY		0x00000800L
#define SQL_CVT_BIT 			0x00001000L
#define SQL_CVT_TINYINT 		0x00002000L
#define SQL_CVT_BIGINT			0x00004000L
#define SQL_CVT_DATE			0x00008000L
#define SQL_CVT_TIME			0x00010000L
#define SQL_CVT_TIMESTAMP		0x00020000L
#define SQL_CVT_LONGVARBINARY		0x00040000L


/*
 *  SQL_CONVERT_FUNCTIONS
 */
#define SQL_FN_CVT_CONVERT		0x00000001L


/*
 *  SQL_STRING_FUNCTIONS
 */
#define SQL_FN_STR_CONCAT		0x00000001L
#define SQL_FN_STR_INSERT		0x00000002L
#define SQL_FN_STR_LEFT 		0x00000004L
#define SQL_FN_STR_LTRIM		0x00000008L
#define SQL_FN_STR_LENGTH		0x00000010L
#define SQL_FN_STR_LOCATE		0x00000020L
#define SQL_FN_STR_LCASE		0x00000040L
#define SQL_FN_STR_REPEAT		0x00000080L
#define SQL_FN_STR_REPLACE		0x00000100L
#define SQL_FN_STR_RIGHT		0x00000200L
#define SQL_FN_STR_RTRIM		0x00000400L
#define SQL_FN_STR_SUBSTRING		0x00000800L
#define SQL_FN_STR_UCASE		0x00001000L
#define SQL_FN_STR_ASCII		0x00002000L
#define SQL_FN_STR_CHAR 		0x00004000L
#define SQL_FN_STR_DIFFERENCE		0x00008000L
#define SQL_FN_STR_LOCATE_2 		0x00010000L
#define SQL_FN_STR_SOUNDEX		0x00020000L
#define SQL_FN_STR_SPACE		0x00040000L


/*
 *  SQL_NUMERIC_FUNCTIONS
 */
#define SQL_FN_NUM_ABS			0x00000001L
#define SQL_FN_NUM_ACOS 		0x00000002L
#define SQL_FN_NUM_ASIN 		0x00000004L
#define SQL_FN_NUM_ATAN 		0x00000008L
#define SQL_FN_NUM_ATAN2		0x00000010L
#define SQL_FN_NUM_CEILING		0x00000020L
#define SQL_FN_NUM_COS			0x00000040L
#define SQL_FN_NUM_COT			0x00000080L
#define SQL_FN_NUM_EXP			0x00000100L
#define SQL_FN_NUM_FLOOR		0x00000200L
#define SQL_FN_NUM_LOG			0x00000400L
#define SQL_FN_NUM_MOD			0x00000800L
#define SQL_FN_NUM_SIGN		 	0x00001000L
#define SQL_FN_NUM_SIN			0x00002000L
#define SQL_FN_NUM_SQRT		 	0x00004000L
#define SQL_FN_NUM_TAN			0x00008000L
#define SQL_FN_NUM_PI			0x00010000L
#define SQL_FN_NUM_RAND		 	0x00020000L
#define SQL_FN_NUM_DEGREES		0x00040000L
#define SQL_FN_NUM_LOG10		0x00080000L
#define SQL_FN_NUM_POWER		0x00100000L
#define SQL_FN_NUM_RADIANS		0x00200000L
#define SQL_FN_NUM_ROUND		0x00400000L
#define SQL_FN_NUM_TRUNCATE 		0x00800000L


/*
 *  SQL_TIMEDATE_FUNCTIONS
 */
#define SQL_FN_TD_NOW			0x00000001L
#define SQL_FN_TD_CURDATE		0x00000002L
#define SQL_FN_TD_DAYOFMONTH		0x00000004L
#define SQL_FN_TD_DAYOFWEEK 		0x00000008L
#define SQL_FN_TD_DAYOFYEAR 		0x00000010L
#define SQL_FN_TD_MONTH 		0x00000020L
#define SQL_FN_TD_QUARTER		0x00000040L
#define SQL_FN_TD_WEEK			0x00000080L
#define SQL_FN_TD_YEAR			0x00000100L
#define SQL_FN_TD_CURTIME		0x00000200L
#define SQL_FN_TD_HOUR			0x00000400L
#define SQL_FN_TD_MINUTE		0x00000800L
#define SQL_FN_TD_SECOND		0x00001000L
#define SQL_FN_TD_TIMESTAMPADD		0x00002000L
#define SQL_FN_TD_TIMESTAMPDIFF 	0x00004000L
#define SQL_FN_TD_DAYNAME		0x00008000L
#define SQL_FN_TD_MONTHNAME 		0x00010000L


/*
 *  SQL_SYSTEM_FUNCTIONS
 */
#define SQL_FN_SYS_USERNAME 		0x00000001L
#define SQL_FN_SYS_DBNAME		0x00000002L
#define SQL_FN_SYS_IFNULL		0x00000004L


/*
 *  SQL_TIMEDATE_ADD_INTERVALS
 *  SQL_TIMEDATE_DIFF_INTERVALS
 */
#define SQL_FN_TSI_FRAC_SECOND		0x00000001L
#define SQL_FN_TSI_SECOND		0x00000002L
#define SQL_FN_TSI_MINUTE		0x00000004L
#define SQL_FN_TSI_HOUR 		0x00000008L
#define SQL_FN_TSI_DAY			0x00000010L
#define SQL_FN_TSI_WEEK 		0x00000020L
#define SQL_FN_TSI_MONTH		0x00000040L
#define SQL_FN_TSI_QUARTER		0x00000080L
#define SQL_FN_TSI_YEAR 		0x00000100L


/*
 *  SQL_ODBC_API_CONFORMANCE
 */
#define SQL_OAC_NONE			0x0000
#define SQL_OAC_LEVEL1			0x0001
#define SQL_OAC_LEVEL2			0x0002


/*
 * SQL_ODBC_SAG_CLI_CONFORMANCE
 */
#define SQL_OSCC_NOT_COMPLIANT		0x0000
#define SQL_OSCC_COMPLIANT		0x0001


/*
 *  SQL_ODBC_SQL_CONFORMANCE
 */
#define SQL_OSC_MINIMUM 		0x0000
#define SQL_OSC_CORE			0x0001
#define SQL_OSC_EXTENDED		0x0002


/*
 *  SQL_CONCAT_NULL_BEHAVIOR
 */
#define SQL_CB_NULL 			0x0000
#define SQL_CB_NON_NULL		 	0x0001


/*
 *  SQL_CURSOR_COMMIT_BEHAVIOR
 *  SQL_CURSOR_ROLLBACK_BEHAVIOR
 */
#define SQL_CB_DELETE			0x0000
#define SQL_CB_CLOSE			0x0001
#define SQL_CB_PRESERVE			0x0002


/*
 *  SQL_IDENTIFIER_CASE
 */
#define SQL_IC_UPPER			0x0001
#define SQL_IC_LOWER			0x0002
#define SQL_IC_SENSITIVE		0x0003
#define SQL_IC_MIXED			0x0004


/*
 *  SQL_TXN_CAPABLE
 */
#define SQL_TC_NONE 			0x0000
#define SQL_TC_DML			0x0001
#define SQL_TC_ALL			0x0002
#define SQL_TC_DDL_COMMIT		0x0003
#define SQL_TC_DDL_IGNORE		0x0004


/*
 *  SQL_SCROLL_OPTIONS
 */
#define SQL_SO_FORWARD_ONLY 		0x00000001L
#define SQL_SO_KEYSET_DRIVEN		0x00000002L
#define SQL_SO_DYNAMIC			0x00000004L
#define SQL_SO_MIXED			0x00000008L
#define SQL_SO_STATIC			0x00000010L


/*
 * SQL_SCROLL_CONCURRENCY
 */
#define SQL_SCCO_READ_ONLY		0x00000001L
#define SQL_SCCO_LOCK			0x00000002L
#define SQL_SCCO_OPT_ROWVER 		0x00000004L
#define SQL_SCCO_OPT_VALUES 		0x00000008L


/*
 *  SQL_FETCH_DIRECTION
 */
#define SQL_FD_FETCH_NEXT		0x00000001L
#define SQL_FD_FETCH_FIRST		0x00000002L
#define SQL_FD_FETCH_LAST		0x00000004L
#define SQL_FD_FETCH_PRIOR		0x00000008L
#define SQL_FD_FETCH_ABSOLUTE		0x00000010L
#define SQL_FD_FETCH_RELATIVE		0x00000020L
#define SQL_FD_FETCH_RESUME 		0x00000040L
#define SQL_FD_FETCH_BOOKMARK		0x00000080L


/*
 *  SQL_TXN_ISOLATION_OPTION
 */
#define SQL_TXN_READ_UNCOMMITTED	0x00000001L
#define SQL_TXN_READ_COMMITTED		0x00000002L
#define SQL_TXN_REPEATABLE_READ 	0x00000004L
#define SQL_TXN_SERIALIZABLE		0x00000008L
#define SQL_TXN_VERSIONING		0x00000010L


/*
 *  SQL_CORRELATION_NAME
 */
#define SQL_CN_NONE 			0x0000
#define SQL_CN_DIFFERENT		0x0001
#define SQL_CN_ANY			0x0002


/*
 * SQL_NON_NULLABLE_COLUMNS
 */
#define SQL_NNC_NULL			0x0000
#define SQL_NNC_NON_NULL		0x0001


/*
 *  SQL_NULL_COLLATION
 */
#define SQL_NC_HIGH 			0x0000
#define SQL_NC_LOW			0x0001
#define SQL_NC_START			0x0002
#define SQL_NC_END			0x0004


/*
 * SQL_FILE_USAGE
 */
#define SQL_FILE_NOT_SUPPORTED		0x0000
#define SQL_FILE_TABLE			0x0001
#define SQL_FILE_QUALIFIER		0x0002


/*
 *  SQL_GETDATA_EXTENSIONS
 */
#define SQL_GD_ANY_COLUMN		0x00000001L
#define SQL_GD_ANY_ORDER		0x00000002L
#define SQL_GD_BLOCK			0x00000004L
#define SQL_GD_BOUND			0x00000008L


/*
 * SQL_ALTER_TABLE
 */
#define SQL_AT_ADD_COLUMN		0x00000001L
#define SQL_AT_DROP_COLUMN		0x00000002L


/*
 *  SQL_POSITIONED_STATEMENTS
 */
#define SQL_PS_POSITIONED_DELETE	0x00000001L
#define SQL_PS_POSITIONED_UPDATE	0x00000002L
#define SQL_PS_SELECT_FOR_UPDATE	0x00000004L


/*
 *  SQL_GROUP_BY
 */
#define SQL_GB_NOT_SUPPORTED		0x0000
#define SQL_GB_GROUP_BY_EQUALS_SELECT	0x0001
#define SQL_GB_GROUP_BY_CONTAINS_SELECT	0x0002
#define SQL_GB_NO_RELATION		0x0003


/*
 *  SQL_OWNER_USAGE
 */
#define SQL_OU_DML_STATEMENTS		0x00000001L
#define SQL_OU_PROCEDURE_INVOCATION	0x00000002L
#define SQL_OU_TABLE_DEFINITION 	0x00000004L
#define SQL_OU_INDEX_DEFINITION 	0x00000008L
#define SQL_OU_PRIVILEGE_DEFINITION	0x00000010L


/*
 * SQL_QUALIFIER_USAGE
 */
#define SQL_QU_DML_STATEMENTS		0x00000001L
#define SQL_QU_PROCEDURE_INVOCATION 	0x00000002L
#define SQL_QU_TABLE_DEFINITION 	0x00000004L
#define SQL_QU_INDEX_DEFINITION 	0x00000008L
#define SQL_QU_PRIVILEGE_DEFINITION 	0x00000010L


/*
 *  SQL_SUBQUERIES
 */
#define SQL_SQ_COMPARISON		0x00000001L
#define SQL_SQ_EXISTS			0x00000002L
#define SQL_SQ_IN			0x00000004L
#define SQL_SQ_QUANTIFIED		0x00000008L
#define SQL_SQ_CORRELATED_SUBQUERIES	0x00000010L


/*
 *  SQL_UNION
 */
#define SQL_U_UNION			0x00000001L
#define SQL_U_UNION_ALL			0x00000002L


/*
 *  SQL_BOOKMARK_PERSISTENCE
 */
#define SQL_BP_CLOSE			0x00000001L
#define SQL_BP_DELETE			0x00000002L
#define SQL_BP_DROP 			0x00000004L
#define SQL_BP_TRANSACTION		0x00000008L
#define SQL_BP_UPDATE			0x00000010L
#define SQL_BP_OTHER_HSTMT		0x00000020L
#define SQL_BP_SCROLL			0x00000040L


/*
 * SQL_STATIC_SENSITIVITY
 */
#define SQL_SS_ADDITIONS		0x00000001L
#define SQL_SS_DELETIONS		0x00000002L
#define SQL_SS_UPDATES			0x00000004L


/*
 *  SQL_LOCK_TYPES
 */
#define SQL_LCK_NO_CHANGE		0x00000001L
#define SQL_LCK_EXCLUSIVE		0x00000002L
#define SQL_LCK_UNLOCK			0x00000004L


/*
 *  SQL_POS_OPERATIONS
 */
#define SQL_POS_POSITION		0x00000001L
#define SQL_POS_REFRESH 		0x00000002L
#define SQL_POS_UPDATE			0x00000004L
#define SQL_POS_DELETE			0x00000008L
#define SQL_POS_ADD			0x00000010L


/*
 *  SQL_QUALIFIER_LOCATION
 */
#define SQL_QL_START			0x0001L
#define SQL_QL_END			0x0002L


/*
 *  SQL_OJ_CAPABILITIES
 */
#define SQL_OJ_LEFT			0x00000001L
#define SQL_OJ_RIGHT			0x00000002L
#define SQL_OJ_FULL			0x00000004L
#define SQL_OJ_NESTED			0x00000008L
#define SQL_OJ_NOT_ORDERED		0x00000010L
#define SQL_OJ_INNER			0x00000020L
#define SQL_OJ_ALL_COMPARISON_OPS	0x00000040L


/*
 *  SQLGetStmtOption/SQLSetStmtOption
 */
#define SQL_QUERY_TIMEOUT		0
#define SQL_MAX_ROWS			1
#define SQL_NOSCAN			2
#define SQL_MAX_LENGTH			3
#define SQL_ASYNC_ENABLE		4
#define SQL_BIND_TYPE			5
#define SQL_CURSOR_TYPE 		6
#define SQL_CONCURRENCY 		7
#define SQL_KEYSET_SIZE 		8
#define SQL_ROWSET_SIZE 		9
#define SQL_SIMULATE_CURSOR 		10
#define SQL_RETRIEVE_DATA		11
#define SQL_USE_BOOKMARKS		12
#define SQL_GET_BOOKMARK		13
#define SQL_ROW_NUMBER			14

#define SQL_STMT_OPT_MIN		SQL_QUERY_TIMEOUT
#define SQL_STMT_OPT_MAX		SQL_ROW_NUMBER


/*
 * SQL_QUERY_TIMEOUT
 */
#define SQL_QUERY_TIMEOUT_DEFAULT	0UL


/*
 *  SQL_MAX_ROWS
 */
#define SQL_MAX_ROWS_DEFAULT		0UL


/*
 *  SQL_NOSCAN
 */
#define SQL_NOSCAN_OFF			0UL	/* 1.0 FALSE */
#define SQL_NOSCAN_ON			1UL	/* 1.0 TRUE */
#define SQL_NOSCAN_DEFAULT		SQL_NOSCAN_OFF


/*
 *  SQL_MAX_LENGTH
 */
#define SQL_MAX_LENGTH_DEFAULT		0UL


/*
 *  SQL_ASYNC_ENABLE
 */
#define SQL_ASYNC_ENABLE_OFF		0UL
#define SQL_ASYNC_ENABLE_ON		1UL
#define SQL_ASYNC_ENABLE_DEFAULT	SQL_ASYNC_ENABLE_OFF


/*
 *  SQL_BIND_TYPE
 */
#define SQL_BIND_BY_COLUMN		0UL
#define SQL_BIND_TYPE_DEFAULT		SQL_BIND_BY_COLUMN


/*
 *  SQL_CONCURRENCY
 */
#define SQL_CONCUR_READ_ONLY		1
#define SQL_CONCUR_LOCK 		2
#define SQL_CONCUR_ROWVER		3
#define SQL_CONCUR_VALUES		4
#define SQL_CONCUR_DEFAULT		SQL_CONCUR_READ_ONLY


/*
 *  SQL_CURSOR_TYPE
 */
#define SQL_CURSOR_FORWARD_ONLY 	0UL
#define SQL_CURSOR_KEYSET_DRIVEN	1UL
#define SQL_CURSOR_DYNAMIC		2UL
#define SQL_CURSOR_STATIC		3UL
#define SQL_CURSOR_TYPE_DEFAULT		SQL_CURSOR_FORWARD_ONLY


/*
 *  SQL_ROWSET_SIZE
 */
#define SQL_ROWSET_SIZE_DEFAULT 	1UL


/*
 *  SQL_KEYSET_SIZE
 */
#define SQL_KEYSET_SIZE_DEFAULT		0UL


/*
 *  SQL_SIMULATE_CURSOR
 */
#define SQL_SC_NON_UNIQUE		0UL
#define SQL_SC_TRY_UNIQUE		1UL
#define SQL_SC_UNIQUE			2UL


/*
 *  SQL_RETRIEVE_DATA
 */
#define SQL_RD_OFF			0UL
#define SQL_RD_ON			1UL
#define SQL_RD_DEFAULT			SQL_RD_ON


/*
 *  SQL_USE_BOOKMARKS
 */
#define SQL_UB_OFF			0UL
#define SQL_UB_ON			1UL
#define SQL_UB_DEFAULT			SQL_UB_OFF


/*
 *  SQLSetConnectOption/SQLGetConnectOption
 */
#define SQL_ACCESS_MODE		 	101
#define SQL_AUTOCOMMIT			102
#define SQL_LOGIN_TIMEOUT		103
#define SQL_OPT_TRACE			104
#define SQL_OPT_TRACEFILE		105
#define SQL_TRANSLATE_DLL		106
#define SQL_TRANSLATE_OPTION		107
#define SQL_TXN_ISOLATION		108
#define SQL_CURRENT_QUALIFIER		109
#define SQL_ODBC_CURSORS		110
#define SQL_QUIET_MODE			111
#define SQL_PACKET_SIZE		 	112

#define	SQL_CONN_OPT_MIN		SQL_ACCESS_MODE
#define SQL_CONN_OPT_MAX		SQL_PACKET_SIZE
#define SQL_CONNECT_OPT_DRVR_START	1000


/*
 *  SQL_ACCESS_MODE
 */
#define SQL_MODE_READ_WRITE 		0UL
#define SQL_MODE_READ_ONLY		1UL
#define SQL_MODE_DEFAULT		SQL_MODE_READ_WRITE


/*
 *  SQL_AUTOCOMMIT
 */
#define SQL_AUTOCOMMIT_OFF		0UL
#define SQL_AUTOCOMMIT_ON		1UL
#define SQL_AUTOCOMMIT_DEFAULT		SQL_AUTOCOMMIT_ON


/*
 *  SQL_LOGIN_TIMEOUT
 */
#define SQL_LOGIN_TIMEOUT_DEFAULT	15UL


/*
 *  SQL_OPT_TRACE
 */
#define SQL_OPT_TRACE_OFF		0UL
#define SQL_OPT_TRACE_ON		1UL
#define SQL_OPT_TRACE_DEFAULT		SQL_OPT_TRACE_OFF
#define SQL_OPT_TRACE_FILE_DEFAULT	"odbc.log"


/*
 *  SQL_ODBC_CURSORS
 */
#define SQL_CUR_USE_IF_NEEDED		0UL
#define SQL_CUR_USE_ODBC		1UL
#define SQL_CUR_USE_DRIVER		2UL
#define SQL_CUR_DEFAULT 		SQL_CUR_USE_DRIVER


/*
 *  SQLSpecialColumns - Column types and scopes
 */
#define SQL_BEST_ROWID			1
#define SQL_ROWVER			2

#define SQL_SCOPE_CURROW		0
#define SQL_SCOPE_TRANSACTION		1
#define SQL_SCOPE_SESSION		2


/*
 *  SQLSetPos
 */
#define SQL_ENTIRE_ROWSET		0


/*
 *  SQLSetPos
 */
#define SQL_POSITION			0
#define SQL_REFRESH 			1
#define SQL_UPDATE			2
#define SQL_DELETE			3
#define SQL_ADD				4


/*
 *  SQLSetPos
 */
#define SQL_LOCK_NO_CHANGE		0
#define SQL_LOCK_EXCLUSIVE		1
#define SQL_LOCK_UNLOCK 		2


/*
 *  SQLSetPos
 */
#define SQL_POSITION_TO(hstmt,irow) 	\
    SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE)
#define SQL_LOCK_RECORD(hstmt,irow,fLock) \
    SQLSetPos(hstmt,irow,SQL_POSITION,fLock)
#define SQL_REFRESH_RECORD(hstmt,irow,fLock) \
    SQLSetPos(hstmt,irow,SQL_REFRESH,fLock)
#define SQL_UPDATE_RECORD(hstmt,irow) \
    SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
#define SQL_DELETE_RECORD(hstmt,irow) \
    SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE)
#define SQL_ADD_RECORD(hstmt,irow) \
    SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)


/*
 *  All the ODBC keywords
 */
#define SQL_ODBC_KEYWORDS \
"ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
"ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
"BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
"CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
"COBOL,COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
"CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
"CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
"DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
"DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
"DISTINCT,DOMAIN,DOUBLE,DROP,"\
"ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
"EXISTS,EXTERNAL,EXTRACT,"\
"FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
"GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
"IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
"INPUT,INSENSITIVE,INSERT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
"JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
"MATCH,MAX,MIN,MINUTE,MODULE,MONTH,MUMPS,"\
"NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
"OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
"PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
"PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
"REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS,"\
"SCHEMA,SCROLL,SECOND,SECTION,SELECT,SEQUENCE,SESSION,SESSION_USER,SET,SIZE,"\
"SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
"SUBSTRING,SUM,SYSTEM_USER,"\
"TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
"TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
"UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
"VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,YEAR"


/*
 * ----------------------------------------------------------------------
 *  Level 2 Functions
 * ----------------------------------------------------------------------
 */

/*
 *  SQLExtendedFetch - fFetchType
 */
#define SQL_FETCH_NEXT			1
#define SQL_FETCH_FIRST 		2
#define SQL_FETCH_LAST			3
#define SQL_FETCH_PRIOR			4
#define SQL_FETCH_ABSOLUTE		5
#define SQL_FETCH_RELATIVE		6
#define SQL_FETCH_BOOKMARK		8


/*
 *  SQLExtendedFetch - rgfRowStatus
 */
#define SQL_ROW_SUCCESS 		0
#define SQL_ROW_DELETED 		1
#define SQL_ROW_UPDATED 		2
#define SQL_ROW_NOROW			3
#define SQL_ROW_ADDED			4
#define SQL_ROW_ERROR			5


/*
 *  SQLForeignKeys - UPDATE_RULE/DELETE_RULE
 */
#define SQL_CASCADE 			0
#define SQL_RESTRICT			1
#define SQL_SET_NULL			2
#define SQL_NO_ACTION			3
#define SQL_SET_DEFAULT			4


/*
 *  SQLBindParameter - fParamType
 *  SQLProcedureColumns - COLUMN_TYPE
 */
#define SQL_PARAM_TYPE_UNKNOWN		0
#define SQL_PARAM_INPUT			1
#define SQL_PARAM_INPUT_OUTPUT		2
#define SQL_RESULT_COL			3
#define SQL_PARAM_OUTPUT		4
#define SQL_RETURN_VALUE		5


/*
 *  SQLSetParam to SQLBindParameter conversion
 */
#define SQL_PARAM_TYPE_DEFAULT		SQL_PARAM_INPUT_OUTPUT
#define SQL_SETPARAM_VALUE_MAX		(-1L)


/*
 *  SQLStatistics - fUnique
 */
#define SQL_INDEX_UNIQUE		0
#define SQL_INDEX_ALL			1


/*
 *  SQLStatistics - fAccuracy
 */
#define SQL_QUICK			0
#define SQL_ENSURE			1


/*
 *  SQLStatistics - TYPE
 */
#define SQL_TABLE_STAT			0
#define SQL_INDEX_CLUSTERED 		1
#define SQL_INDEX_HASHED		2
#define SQL_INDEX_OTHER 		3


/*
 *  SQLProcedures - PROCEDURE_TYPE
 */
#define SQL_PT_UNKNOWN			0
#define SQL_PT_PROCEDURE		1
#define SQL_PT_FUNCTION 		2


/*
 *  SQLSpecialColumns - PSEUDO_COLUMN
 */
#define SQL_PC_UNKNOWN			0
#define SQL_PC_NOT_PSEUDO		1
#define SQL_PC_PSEUDO			2


/*
 *  Deprecated defines from prior versions of ODBC
 */
#define SQL_DATABASE_NAME 		16
#define SQL_FD_FETCH_PREV		SQL_FD_FETCH_PRIOR
#define SQL_FETCH_PREV			SQL_FETCH_PRIOR
#define SQL_CONCUR_TIMESTAMP		SQL_CONCUR_ROWVER
#define SQL_SCCO_OPT_TIMESTAMP		SQL_SCCO_OPT_ROWVER
#define SQL_CC_DELETE			SQL_CB_DELETE
#define SQL_CR_DELETE			SQL_CB_DELETE
#define SQL_CC_CLOSE			SQL_CB_CLOSE
#define SQL_CR_CLOSE			SQL_CB_CLOSE
#define SQL_CC_PRESERVE 		SQL_CB_PRESERVE
#define SQL_CR_PRESERVE 		SQL_CB_PRESERVE
#define SQL_FETCH_RESUME		7
#define SQL_SCROLL_FORWARD_ONLY 	0L
#define SQL_SCROLL_KEYSET_DRIVEN	(-1L)
#define SQL_SCROLL_DYNAMIC		(-2L)
#define SQL_SCROLL_STATIC		(-3L)
#define SQL_PC_NON_PSEUDO		SQL_PC_NOT_PSEUDO


/*
 *  Level 1 function rototypes
 */

SQLRETURN SQL_API SQLColumns (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName,
    SQLCHAR FAR * szColumnName,
    SQLSMALLINT cbColumnName);

SQLRETURN SQL_API SQLGetConnectOption (
    SQLHDBC hdbc,
    SQLUSMALLINT fOption,
    SQLPOINTER pvParam);

SQLRETURN SQL_API SQLGetData (
    SQLHSTMT hstmt,
    SQLUSMALLINT icol,
    SQLSMALLINT fCType,
    SQLPOINTER rgbValue,
    SQLINTEGER cbValueMax,
    SQLINTEGER FAR * pcbValue);

SQLRETURN SQL_API SQLGetFunctions (
    SQLHDBC hdbc,
    SQLUSMALLINT fFunction,
    SQLUSMALLINT FAR * pfExists);

SQLRETURN SQL_API SQLGetInfo (
    SQLHDBC hdbc,
    SQLUSMALLINT fInfoType,
    SQLPOINTER rgbInfoValue,
    SQLSMALLINT cbInfoValueMax,
    SQLSMALLINT FAR * pcbInfoValue);

SQLRETURN SQL_API SQLGetStmtOption (
    SQLHSTMT hstmt,
    SQLUSMALLINT fOption,
    SQLPOINTER pvParam);

SQLRETURN SQL_API SQLGetTypeInfo (
    SQLHSTMT hstmt,
    SQLSMALLINT fSqlType);

SQLRETURN SQL_API SQLParamData (
    SQLHSTMT hstmt,
    SQLPOINTER FAR * prgbValue);

SQLRETURN SQL_API SQLPutData (
    SQLHSTMT hstmt,
    SQLPOINTER rgbValue,
    SQLINTEGER cbValue);

SQLRETURN SQL_API SQLSetConnectOption (
    SQLHDBC hdbc,
    SQLUSMALLINT fOption,
    SQLUINTEGER vParam);

SQLRETURN SQL_API SQLSetStmtOption (
    SQLHSTMT hstmt,
    SQLUSMALLINT fOption,
    SQLUINTEGER vParam);

SQLRETURN SQL_API SQLSpecialColumns (
    SQLHSTMT hstmt,
    SQLUSMALLINT fColType,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName,
    SQLUSMALLINT fScope,
    SQLUSMALLINT fNullable);

SQLRETURN SQL_API SQLStatistics (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName,
    SQLUSMALLINT fUnique,
    SQLUSMALLINT fAccuracy);

SQLRETURN SQL_API SQLTables (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName,
    SQLCHAR FAR * szTableType,
    SQLSMALLINT cbTableType);


SQLRETURN SQL_API SQLDriverConnect(
    SQLHDBC            hdbc,
    SQLHWND            hwnd,
    SQLCHAR FAR       *szConnStrIn,
    SQLSMALLINT        cbConnStrIn,
    SQLCHAR FAR       *szConnStrOut,
    SQLSMALLINT        cbConnStrOutMax,
    SQLSMALLINT FAR   *pcbConnStrOut,
    SQLUSMALLINT       fDriverCompletion);

/*
 *  Level 2 function prototypes
 */
SQLRETURN SQL_API SQLBrowseConnect (
    SQLHDBC hdbc,
    SQLCHAR FAR * szConnStrIn,
    SQLSMALLINT cbConnStrIn,
    SQLCHAR FAR * szConnStrOut,
    SQLSMALLINT cbConnStrOutMax,
    SQLSMALLINT FAR * pcbConnStrOut);

SQLRETURN SQL_API SQLColumnPrivileges (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName,
    SQLCHAR FAR * szColumnName,
    SQLSMALLINT cbColumnName);

SQLRETURN SQL_API SQLDataSources (
    SQLHENV henv,
    SQLUSMALLINT fDirection,
    SQLCHAR FAR * szDSN,
    SQLSMALLINT cbDSNMax,
    SQLSMALLINT FAR * pcbDSN,
    SQLCHAR FAR * szDescription,
    SQLSMALLINT cbDescriptionMax,
    SQLSMALLINT FAR * pcbDescription);

SQLRETURN SQL_API SQLDescribeParam (
    SQLHSTMT hstmt,
    SQLUSMALLINT ipar,
    SQLSMALLINT FAR * pfSqlType,
    SQLUINTEGER FAR * pcbParamDef,
    SQLSMALLINT FAR * pibScale,
    SQLSMALLINT FAR * pfNullable);

SQLRETURN SQL_API SQLExtendedFetch (
    SQLHSTMT hstmt,
    SQLUSMALLINT fFetchType,
    SQLINTEGER irow,
    SQLUINTEGER FAR * pcrow,
    SQLUSMALLINT FAR * rgfRowStatus);

SQLRETURN SQL_API SQLForeignKeys (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szPkCatalogName,
    SQLSMALLINT cbPkCatalogName,
    SQLCHAR FAR * szPkSchemaName,
    SQLSMALLINT cbPkSchemaName,
    SQLCHAR FAR * szPkTableName,
    SQLSMALLINT cbPkTableName,
    SQLCHAR FAR * szFkCatalogName,
    SQLSMALLINT cbFkCatalogName,
    SQLCHAR FAR * szFkSchemaName,
    SQLSMALLINT cbFkSchemaName,
    SQLCHAR FAR * szFkTableName,
    SQLSMALLINT cbFkTableName);

SQLRETURN SQL_API SQLMoreResults (
    SQLHSTMT hstmt);

SQLRETURN SQL_API SQLNativeSql (
    SQLHDBC hdbc,
    SQLCHAR FAR * szSqlStrIn,
    SQLINTEGER cbSqlStrIn,
    SQLCHAR FAR * szSqlStr,
    SQLINTEGER cbSqlStrMax,
    SQLINTEGER FAR * pcbSqlStr);

SQLRETURN SQL_API SQLNumParams (
    SQLHSTMT hstmt,
    SQLSMALLINT FAR * pcpar);

SQLRETURN SQL_API SQLParamOptions (
    SQLHSTMT hstmt,
    SQLUINTEGER crow,
    SQLUINTEGER FAR * pirow);

SQLRETURN SQL_API SQLPrimaryKeys (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName);

SQLRETURN SQL_API SQLProcedureColumns (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szProcName,
    SQLSMALLINT cbProcName,
    SQLCHAR FAR * szColumnName,
    SQLSMALLINT cbColumnName);

SQLRETURN SQL_API SQLProcedures (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szProcName,
    SQLSMALLINT cbProcName);

SQLRETURN SQL_API SQLSetPos (
    SQLHSTMT hstmt,
    SQLUSMALLINT irow,
    SQLUSMALLINT fOption,
    SQLUSMALLINT fLock);

SQLRETURN SQL_API SQLTablePrivileges (
    SQLHSTMT hstmt,
    SQLCHAR FAR * szCatalogName,
    SQLSMALLINT cbCatalogName,
    SQLCHAR FAR * szSchemaName,
    SQLSMALLINT cbSchemaName,
    SQLCHAR FAR * szTableName,
    SQLSMALLINT cbTableName);


/*
 *  SDK 2.0 Additional function prototypes
 */
SQLRETURN SQL_API SQLDrivers (
    SQLHENV henv,
    SQLUSMALLINT fDirection,
    SQLCHAR FAR * szDriverDesc,
    SQLSMALLINT cbDriverDescMax,
    SQLSMALLINT FAR * pcbDriverDesc,
    SQLCHAR FAR * szDriverAttributes,
    SQLSMALLINT cbDrvrAttrMax,
    SQLSMALLINT FAR * pcbDrvrAttr);

SQLRETURN SQL_API SQLBindParameter (
    SQLHSTMT hstmt,
    SQLUSMALLINT ipar,
    SQLSMALLINT fParamType,
    SQLSMALLINT fCType,
    SQLSMALLINT fSqlType,
    SQLUINTEGER cbColDef,
    SQLSMALLINT ibScale,
    SQLPOINTER rgbValue,
    SQLINTEGER cbValueMax,
    SQLINTEGER FAR * pcbValue);


/*
 *  Depreciated - use SQLSetStmtOptions
 */
SQLRETURN SQL_API SQLSetScrollOptions (		/* Use SQLSetStmtOptions */
    SQLHSTMT hstmt,
    SQLUSMALLINT fConcurrency,
    SQLINTEGER crowKeyset,
    SQLUSMALLINT crowRowset);


#ifdef __cplusplus
}
#endif

#endif /* _SQLEXT_H */