📄 isqlext.h
字号:
/*
*
* isqlext.h
*
* $Id: isqlext.h,v 1.1 2005/03/16 06:49:16 kehc Exp $
*
* iODBC 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 _ISQLEXT_H
# define _ISQLEXT_H
#include "wx/isql.h"
/*
* Generic constants
*/
#define SQL_MAX_OPTION_STRING_LENGTH 256
/*
* 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_TYPE_DRIVER_START SQL_INTERVAL_YEAR
#define SQL_TYPE_DRIVER_END SQL_UNICODE
#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
/*
* SQL portable types for C - DATE, TIME, TIMESTAMP
*/
typedef struct _DATE_STRUCT
{
SWORD year;
UWORD month;
UWORD day;
}
DATE_STRUCT;
typedef struct _TIME_STRUCT
{
UWORD hour;
UWORD minute;
UWORD second;
}
TIME_STRUCT;
typedef struct _TIMESTAMP_STRUCT
{
SWORD year;
UWORD month;
UWORD day;
UWORD hour;
UWORD minute;
UWORD second;
UDWORD fraction;
}
TIMESTAMP_STRUCT;
typedef unsigned long int BOOKMARK;
/*
* ----------------------------------------------------------------------
* 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)
/*
* 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
/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -