Skip to content

Commit

Permalink
Add some datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
lurcher committed Feb 12, 2025
1 parent afdce51 commit ba1a44d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Various mem buffers fixes. Thanks chipitsine
* Fix race condition with threaded applications where SQLGetPrivateProfileString can fail
due to collision with loading driver library during connection
* Added some ODBC 4 types to sql.h

8-Aug-2023
2.3.12
Expand Down
17 changes: 15 additions & 2 deletions DriverManager/SQLBindCol.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ int check_target_type( int c_type, int connection_mode)
return 1;
}


switch( c_type ) {
case SQL_UNKNOWN_TYPE:
case SQL_C_CHAR:
case SQL_C_LONG:
case SQL_C_SHORT:
Expand Down Expand Up @@ -179,8 +179,21 @@ int check_target_type( int c_type, int connection_mode)
case SQL_C_UTINYINT:
case SQL_C_GUID:
case SQL_C_WCHAR:
case SQL_ARD_TYPE:
case SQL_C_DOUBLE:
#if (ODBCVER >= 0x0400)
case SQL_TYPE_TIME_WITH_TIMEZONE:
case SQL_TYPE_TIMESTAMP_WITH_TIMEZONE:
case SQL_UDT:
case SQL_ROW:
case SQL_ARRAY:
case SQL_MULTISET:
#endif /* ODBCVER >= 0x0400 */
#if (ODBCVER >= 0x0300)
case SQL_ARD_TYPE:
#endif
#if (ODBCVER >= 0x0380)
case SQL_APD_TYPE:
#endif
/*
* MS Added types
*/
Expand Down
34 changes: 34 additions & 0 deletions include/sql.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ extern "C" {
#define SQL_DESC_ALLOC_TYPE 1099
#endif

#if (ODBCVER >= 0x0400)
#define SQL_DESC_CHARACTER_SET_CATALOG 1018
#define SQL_DESC_CHARACTER_SET_SCHEMA 1019
#define SQL_DESC_CHARACTER_SET_NAME 1020
#define SQL_DESC_COLLATION_CATALOG 1015
#define SQL_DESC_COLLATION_SCHEMA 1016
#define SQL_DESC_COLLATION_NAME 1017
#define SQL_DESC_USER_DEFINED_TYPE_CATALOG 1026
#define SQL_DESC_USER_DEFINED_TYPE_SCHEMA 1027
#define SQL_DESC_USER_DEFINED_TYPE_NAME 1028
#endif /* ODBCVER >= 0x0400 */

/* identifiers of fields in the diagnostics area */
#if (ODBCVER >= 0x0300)
#define SQL_DIAG_RETURNCODE 1
Expand Down Expand Up @@ -184,6 +196,19 @@ extern "C" {
#define SQL_TYPE_TIMESTAMP 93
#endif

#if (ODBCVER >= 0x0400)
#define SQL_TYPE_TIME_WITH_TIMEZONE 94
#define SQL_TYPE_TIMESTAMP_WITH_TIMEZONE 95
#endif /* ODBCVER >= 0x0400 */

#if (ODBCVER >= 0x0400)
#define SQL_VARIANT_TYPE SQL_UNKNOWN_TYPE
#define SQL_UDT 17
#define SQL_ROW 19
#define SQL_ARRAY 50
#define SQL_MULTISET 55
#endif /* ODBCVER >= 0x0400 */

/* Statement attribute values for cursor sensitivity */
#if (ODBCVER >= 0x0300)
#define SQL_UNSPECIFIED 0
Expand All @@ -206,13 +231,22 @@ extern "C" {
#define SQL_ARD_TYPE (-99)
#endif

#if (ODBCVER >= 0x0380)
#define SQL_APD_TYPE (-100)
#endif

/* SQL date/time type subcodes */
#if (ODBCVER >= 0x0300)
#define SQL_CODE_DATE 1
#define SQL_CODE_TIME 2
#define SQL_CODE_TIMESTAMP 3
#endif

#if (ODBCVER >= 0x0400)
#define SQL_CODE_TIME_WITH_TIMEZONE 4
#define SQL_CODE_TIMESTAMP_WITH_TIMEZONE 5
#endif /* ODBCVER >= 0x0400 */

/* CLI option values */
#if (ODBCVER >= 0x0300)
#define SQL_FALSE 0
Expand Down

0 comments on commit ba1a44d

Please sign in to comment.