📄 sql.h
字号:
/* * The contents of this file are subject to the MonetDB Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is the MonetDB Database System. * * The Initial Developer of the Original Code is CWI. * Portions created by CWI are Copyright (C) 1997-2007 CWI. * All Rights Reserved. *//************************************************** * sql.h * * These should be consistent with the MS version. * **************************************************/#ifndef __SQL_H#define __SQL_H/**************************** * default to 3.52 declare something else before here and you get a whole new ball of wax ***************************/#ifndef ODBCVER#define ODBCVER 0x0352#endif#include "sqltypes.h"#ifdef __cplusplusextern "C" {#endif/* special length/indicator values */#define SQL_NULL_DATA (-1)#define SQL_DATA_AT_EXEC (-2)/* return values from functions */#define SQL_SUCCESS 0#define SQL_SUCCESS_WITH_INFO 1#if (ODBCVER >= 0x0300)#define SQL_NO_DATA 100#endif#define SQL_ERROR (-1)#define SQL_INVALID_HANDLE (-2)#define SQL_STILL_EXECUTING 2#define SQL_NEED_DATA 99/* test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO */#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)/* flags for null-terminated string */#define SQL_NTS (-3)#define SQL_NTSL (-3L)/* maximum message length */#define SQL_MAX_MESSAGE_LENGTH 512/* date/time length constants */#if (ODBCVER >= 0x0300)#define SQL_DATE_LEN 10#define SQL_TIME_LEN 8 /* add P+1 if precision is nonzero */#define SQL_TIMESTAMP_LEN 19 /* add P+1 if precision is nonzero */#endif/* handle type identifiers */#if (ODBCVER >= 0x0300)#define SQL_HANDLE_ENV 1#define SQL_HANDLE_DBC 2#define SQL_HANDLE_STMT 3#define SQL_HANDLE_DESC 4#endif/* environment attribute */#if (ODBCVER >= 0x0300)#define SQL_ATTR_OUTPUT_NTS 10001#endif/* connection attributes */#if (ODBCVER >= 0x0300)#define SQL_ATTR_AUTO_IPD 10001#define SQL_ATTR_METADATA_ID 10014#endif /* ODBCVER >= 0x0300 *//* statement attributes */#if (ODBCVER >= 0x0300)#define SQL_ATTR_APP_ROW_DESC 10010#define SQL_ATTR_APP_PARAM_DESC 10011#define SQL_ATTR_IMP_ROW_DESC 10012#define SQL_ATTR_IMP_PARAM_DESC 10013#define SQL_ATTR_CURSOR_SCROLLABLE (-1)#define SQL_ATTR_CURSOR_SENSITIVITY (-2)#endif/* SQL_ATTR_CURSOR_SCROLLABLE values */#if (ODBCVER >= 0x0300)#define SQL_NONSCROLLABLE 0#define SQL_SCROLLABLE 1#endif /* ODBCVER >= 0x0300 *//* identifiers of fields in the SQL descriptor */#if (ODBCVER >= 0x0300)#define SQL_DESC_COUNT 1001#define SQL_DESC_TYPE 1002#define SQL_DESC_LENGTH 1003#define SQL_DESC_OCTET_LENGTH_PTR 1004#define SQL_DESC_PRECISION 1005#define SQL_DESC_SCALE 1006#define SQL_DESC_DATETIME_INTERVAL_CODE 1007#define SQL_DESC_NULLABLE 1008#define SQL_DESC_INDICATOR_PTR 1009#define SQL_DESC_DATA_PTR 1010#define SQL_DESC_NAME 1011#define SQL_DESC_UNNAMED 1012#define SQL_DESC_OCTET_LENGTH 1013#define SQL_DESC_ALLOC_TYPE 1099#endif/* identifiers of fields in the diagnostics area */#if (ODBCVER >= 0x0300)#define SQL_DIAG_RETURNCODE 1#define SQL_DIAG_NUMBER 2#define SQL_DIAG_ROW_COUNT 3#define SQL_DIAG_SQLSTATE 4#define SQL_DIAG_NATIVE 5#define SQL_DIAG_MESSAGE_TEXT 6#define SQL_DIAG_DYNAMIC_FUNCTION 7#define SQL_DIAG_CLASS_ORIGIN 8#define SQL_DIAG_SUBCLASS_ORIGIN 9#define SQL_DIAG_CONNECTION_NAME 10#define SQL_DIAG_SERVER_NAME 11#define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12#endif/* dynamic function codes */#if (ODBCVER >= 0x0300)#define SQL_DIAG_ALTER_DOMAIN 3#define SQL_DIAG_ALTER_TABLE 4#define SQL_DIAG_CALL 7#define SQL_DIAG_CREATE_ASSERTION 6#define SQL_DIAG_CREATE_CHARACTER_SET 8#define SQL_DIAG_CREATE_COLLATION 10#define SQL_DIAG_CREATE_DOMAIN 23#define SQL_DIAG_CREATE_INDEX (-1)#define SQL_DIAG_CREATE_SCHEMA 64#define SQL_DIAG_CREATE_TABLE 77#define SQL_DIAG_CREATE_TRANSLATION 79#define SQL_DIAG_CREATE_VIEW 84#define SQL_DIAG_DELETE_WHERE 19#define SQL_DIAG_DROP_ASSERTION 24#define SQL_DIAG_DROP_CHARACTER_SET 25#define SQL_DIAG_DROP_COLLATION 26#define SQL_DIAG_DROP_DOMAIN 27#define SQL_DIAG_DROP_INDEX (-2)#define SQL_DIAG_DROP_SCHEMA 31#define SQL_DIAG_DROP_TABLE 32#define SQL_DIAG_DROP_TRANSLATION 33#define SQL_DIAG_DROP_VIEW 36#define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38#define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81#define SQL_DIAG_GRANT 48#define SQL_DIAG_INSERT 50#define SQL_DIAG_REVOKE 59#define SQL_DIAG_SELECT_CURSOR 85#define SQL_DIAG_UNKNOWN_STATEMENT 0#define SQL_DIAG_UPDATE_WHERE 82#endif /* ODBCVER >= 0x0300 *//* SQL data type codes */#define SQL_UNKNOWN_TYPE 0#define SQL_CHAR 1#define SQL_NUMERIC 2#define SQL_DECIMAL 3#define SQL_INTEGER 4#define SQL_SMALLINT 5#define SQL_FLOAT 6#define SQL_REAL 7#define SQL_DOUBLE 8#if (ODBCVER >= 0x0300)#define SQL_DATETIME 9#endif#define SQL_VARCHAR 12/* One-parameter shortcuts for date/time data types */#if (ODBCVER >= 0x0300)#define SQL_TYPE_DATE 91#define SQL_TYPE_TIME 92#define SQL_TYPE_TIMESTAMP 93#endif/* Statement attribute values for cursor sensitivity */#if (ODBCVER >= 0x0300)#define SQL_UNSPECIFIED 0#define SQL_INSENSITIVE 1#define SQL_SENSITIVE 2#endif/* GetTypeInfo() request for all data types */#define SQL_ALL_TYPES 0/* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */#if (ODBCVER >= 0x0300)#define SQL_DEFAULT 99#endif/* SQLGetData() code indicating that the application row descriptor * specifies the data type */#if (ODBCVER >= 0x0300)#define SQL_ARD_TYPE (-99)#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/* CLI option values */#if (ODBCVER >= 0x0300)#define SQL_FALSE 0#define SQL_TRUE 1#endif/* values of NULLABLE field in descriptor */#define SQL_NO_NULLS 0#define SQL_NULLABLE 1/* Value returned by SQLGetTypeInfo() to denote that it is * not known whether or not a data type supports null values. */#define SQL_NULLABLE_UNKNOWN 2/* Values returned by SQLGetTypeInfo() to show WHERE clause * supported */#if (ODBCVER >= 0x0300)#define SQL_PRED_NONE 0#define SQL_PRED_CHAR 1#define SQL_PRED_BASIC 2#endif/* values of UNNAMED field in descriptor */#if (ODBCVER >= 0x0300)#define SQL_NAMED 0#define SQL_UNNAMED 1#endif/* values of ALLOC_TYPE field in descriptor */#if (ODBCVER >= 0x0300)#define SQL_DESC_ALLOC_AUTO 1#define SQL_DESC_ALLOC_USER 2#endif/* FreeStmt() options */#define SQL_CLOSE 0#define SQL_DROP 1#define SQL_UNBIND 2#define SQL_RESET_PARAMS 3/* Codes used for FetchOrientation in SQLFetchScroll(), and in SQLDataSources()*/#define SQL_FETCH_NEXT 1#define SQL_FETCH_FIRST 2/* Other codes used for FetchOrientation in SQLFetchScroll() */#define SQL_FETCH_LAST 3#define SQL_FETCH_PRIOR 4#define SQL_FETCH_ABSOLUTE 5#define SQL_FETCH_RELATIVE 6/* SQLEndTran() options */#define SQL_COMMIT 0#define SQL_ROLLBACK 1/* null handles returned by SQLAllocHandle() */#define SQL_NULL_HENV 0#define SQL_NULL_HDBC 0#define SQL_NULL_HSTMT 0#if (ODBCVER >= 0x0300)#define SQL_NULL_HDESC 0#endif/* null handle used in place of parent handle when allocating HENV */#if (ODBCVER >= 0x0300)#define SQL_NULL_HANDLE 0L#endif/* Values that may appear in the result set of SQLSpecialColumns() */#define SQL_SCOPE_CURROW 0#define SQL_SCOPE_TRANSACTION 1#define SQL_SCOPE_SESSION 2#define SQL_PC_UNKNOWN 0#if (ODBCVER >= 0x0300)#define SQL_PC_NON_PSEUDO 1#endif#define SQL_PC_PSEUDO 2/* Reserved value for the IdentifierType argument of SQLSpecialColumns() */#if (ODBCVER >= 0x0300)#define SQL_ROW_IDENTIFIER 1#endif/* Reserved values for UNIQUE argument of SQLStatistics() */#define SQL_INDEX_UNIQUE 0#define SQL_INDEX_ALL 1/* Values that may appear in the result set of SQLStatistics() */#define SQL_INDEX_CLUSTERED 1#define SQL_INDEX_HASHED 2#define SQL_INDEX_OTHER 3/* SQLGetFunctions() values to identify ODBC APIs */#define SQL_API_SQLALLOCCONNECT 1#define SQL_API_SQLALLOCENV 2#if (ODBCVER >= 0x0300)#define SQL_API_SQLALLOCHANDLE 1001#endif#define SQL_API_SQLALLOCSTMT 3#define SQL_API_SQLBINDCOL 4#if (ODBCVER >= 0x0300)#define SQL_API_SQLBINDPARAM 1002#endif#define SQL_API_SQLCANCEL 5#if (ODBCVER >= 0x0300)#define SQL_API_SQLCLOSECURSOR 1003#define SQL_API_SQLCOLATTRIBUTE 6#endif#define SQL_API_SQLCOLUMNS 40#define SQL_API_SQLCONNECT 7#if (ODBCVER >= 0x0300)#define SQL_API_SQLCOPYDESC 1004#endif#define SQL_API_SQLDATASOURCES 57#define SQL_API_SQLDESCRIBECOL 8#define SQL_API_SQLDISCONNECT 9#if (ODBCVER >= 0x0300)#define SQL_API_SQLENDTRAN 1005#endif#define SQL_API_SQLERROR 10#define SQL_API_SQLEXECDIRECT 11#define SQL_API_SQLEXECUTE 12#define SQL_API_SQLFETCH 13#if (ODBCVER >= 0x0300)#define SQL_API_SQLFETCHSCROLL 1021#endif#define SQL_API_SQLFREECONNECT 14#define SQL_API_SQLFREEENV 15#if (ODBCVER >= 0x0300)#define SQL_API_SQLFREEHANDLE 1006#endif#define SQL_API_SQLFREESTMT 16#if (ODBCVER >= 0x0300)#define SQL_API_SQLGETCONNECTATTR 1007#endif#define SQL_API_SQLGETCONNECTOPTION 42#define SQL_API_SQLGETCURSORNAME 17#define SQL_API_SQLGETDATA 43#if (ODBCVER >= 0x0300)#define SQL_API_SQLGETDESCFIELD 1008#define SQL_API_SQLGETDESCREC 1009
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -