!SQL.DEF [117] - SQL definitions !VEDIT=117 ![100] January 21, 2009 09:20 AM Edited by Jack ! Created for use with SQL.SBR ![101] February 8, 2009 09:10 PM ! Revise symbol names (ASQLOP_xxx -> SQLOP_xxx, ! ASQLERR_xxx -> ASQLERR_xxx, MYSQL_TYPE_xxx -> SQL_TYPE_xxx ![102] March 8, 2009 12:10 PM ! Add SQLINFO_CONID, SQLINFO_CONVER, SQLINFO_CONDESCR, change ! cmdhdr.dbmsid to .dbmsconid (connector id) ![103] March 29, 2009 03:13 PM Edited by jacques ! Add DBMSCONID_ODBC, SQLOP_SET_ATTR, various new symbols, ! correct some symbols ![104] April 10, 2009 09:33 PM Edited by jacques ! Change b,2 and b,4 in ST_SQL_CMDHDR to i,2 and i,4 for negs ! Define ASQL_CUR_CONNECTOR_VER (used by Fn'SQL'Check'Ver()), ! free result flags, SQLERR_BADOPTION, SQL_UB_xxx, SQL_ASYNC_xxx, ! change SQL_TYPE to ASQL_TYPE_xxx; add SQLOP_SET_CONATR, _GET_CONATR ![105] October 10, 2009 09:00 AM Edited by jacques ! Change minimum connector version to 1.3 (note that this ! requires A-Shell 1160+ though); add SQLERR_BADFIELDTYPE ![106] December 7, 2009 11:40 AM Edited by jacques ! Define SQL_ENGINE flags - intended to be used for determining ! the database engine and thus the dialect/syntax variations ! supported (although a function has yet to be written to determine ! this.) ![107] August 17, 2010 05:02 PM Edited by jacques ! Add reshdl to the ST_SQL_CMDHDR structure to support multiple ! result sets (up to MAX_SQL_RESULT_SETS) ![108] August 30, 2010 04:28 PM Edited by jacques ! Add psthdl to the ST_SQL_CMDHDR structure to support prepared ! statements (up to MAX_SQL_PREP_STMTS); add new SQLOP_xxx and ! SQLERR_xxx definitions. Add ST_SQL_DATETIME (matches MYSQL_TIME) ![109] October 25, 2010 05:22 PM Edited by jacques ! Remove MAX_SQL_RESULT_SET (there is no max now - you set it) ![110] October 26, 2010 03:45 PM Edited by jacques ! Add SQLINFO_AUTOINCID, SQLINFO_DBNAME, SQLCONF_TRACE ![111] November 08, 2010 03:12 PM Edited by jacques ! Add SQLERR_TOOMANYRESHDLS ![112] January 20, 2012 10:43 AM Edited by jacques ! Add SQLERR_NESTIGNORE ![113] December 21, 2012 01:30 PM Edited by jacques ! Fix misspelled QRYF_REAL ![114] January 8, 2015 04:30 PM Edited by jacques ! Add back misspelled QYRF_REAL (for backwards compatibility) ![115] February 21, 2015 05:20 PM Edited by jacques ! Add SQLOP_DISCONNECT_ALL ![116] April 12, 2016 03:20 PM Edited by jack ! Add ASQLERR_xxx ![117] February 16, 2018 11:43 AM Edited by Jack ! Add FETCHR_NAME, _ORGNAME, _TBLNAM !------------------------------------------------------------------------ ++ifnmap VERSYS_SQL_DEF ! [102] ![100] This is only map statement here - needs to be a map so ![100] it is included in the run (to be displayed with VERSYS.LIT) map1 VERSYS_SQL_DEF,s,40,">>@VERSYS(1)->>sql.def[117]" define ASQL_CUR_CONNECTOR_VER = "1.3" ! [105] current (min) connector ver define MAX_SQL_CONNECTIONS = 10 ! [107] max open connections at one time define DBMSID_MYSQL = 1 ! [102] (old symbol - now deprecated) define DBMSCONID_MYSQL = 1 ! [102] (new symbol naming scheme) define DBMSCONID_ODBC = 2 ! [103] ODBC (including SQL server) !***engine [106] define SQLENGINE_UNKNOWN = 0 ! [106] Unknown DBMS engine define SQLENGINE_MYSQL = 1 ! [106] MySQL define SQLENGINE_SQL_SERVER = 2 ! [106] SQL Server define SQLENGINE_ACCESS = 3 ! [106] Access define SQLENGINE_DB2 = 4 ! [106] DB2 define SQLENGINE_ORACLE = 5 ! [106] Oracle define SQLENGINE_POSTGRES = 6 ! [106] PostGres !***opcodes define SQLOP_INIT_LIB = 1 ! Init lib define SQLOP_CLOSE_LIB = 2 ! End lib define SQLOP_GET_ERRMSG = 3 ! Get error info for last op define SQLOP_INIT_CONN = 4 ! Init connection structure !define SQLOP_OPTIONS = 5 ! (replaced by SQLOP_SET_CONNATR) define SQLOP_CONNECT = 6 ! Connect to database define SQLOP_DISCONNECT = 7 ! Disconnect from database define SQLOP_GET_INFO = 8 ! Get misc info - per flags define SQLOP_QUERY = 9 ! Execute query define SQLOP_FETCH_COLUMNS = 10 ! Fetch field info (for last query) (deprecated name) define SQLOP_GET_COLDEFS = 10 ! Get field (column) definitions for last query (new name) define SQLOP_SET_COLDEFS = 11 ! Set field (column) definitions define SQLOP_FETCH_ROW = 12 ! Fetch next row define SQLOP_FREE_RESULT = 13 ! Free results define SQLOP_GET_CONNATR = 14 ! Get connection attribute define SQLOP_SET_CONNATR = 15 ! Set connection attribute define SQLOP_GET_STMATR = 16 ! Get statement attribute define SQLOP_SET_STMATR = 17 ! Set statement attribute define SQLOP_DATA_SOURCES = 18 ! Get available data source names, descriptions define SQLOP_SET_STMATR = 17 ! Set statement attribute define SQLOP_PST_PREPARE = 20 ! prepare a statement [108] define SQLOP_PST_BIND = 21 ! bind params to prepared stmt define SQLOP_PST_EXECUTE = 22 ! execute prepared stmt define SQLOP_PST_FREE = 23 ! close/free a prepared stmt define SQLOP_DISCONNECT_ALL = 24 ! [115] disconnect all !*** command opflags for SQLOP_GET_INFO define SQLINFO_HOST = 1 ! Get host info define SQLINFO_SERVER = 2 ! Get server info define SQLINFO_CLIENT = 3 ! Get client info define SQLINFO_QUERY = 4 ! Get last query info define SQLINFO_FIELDCOUNT = 5 ! # fields in current row define SQLINFO_ROWCOUNT = 6 ! # rows in result define SQLINFO_CONID = 7 ! [102] connector id (lib name) define SQLINFO_CONVER = 8 ! [102] connector version define SQLINFO_CONDESCR = 9 ! [102] connector description define SQLINFO_AFFECTEDROWS = 10 ! [104] # rows affected by last update query define SQLINFO_AUTOINCID = 11 ! [110] auto-increment value from last insert define SQLINFO_DBNAME = 12 ! [110] database name (as set in SQLOP_CONNECT) !*** command opflags for SQLOP_INIT_CONN ([112] also allowed on SQLOP_INIT for connector 132+) define SQLCONF_TRACE = &h0001 ! [110] turn on connection tracing (into ashlog.log) !*** command opflags for SQLOP_QUERY define QRYF_REAL = &h0001 ! Real (binary) query (len in cmdarg2) [113] was QYRF_ define QYRF_REAL = &h0001 ! [114] misspelled version define QRYF_NOSTORE = &h0002 ! Leave results on server !*** command opflags for SQLOP_FETCH_ROW define FETCHR_FIELDS = &h0000 ! fetch row into discrete field variables define FETCHR_ARRAY = &h0001 ! fetch row into array of strings define FETCHR_ROWSTR = &h0002 ! fetch row into single row string (XTREE style) define FETCHR_DELIMITER = &h0004 ! fetch row into single delimited string define FETCHR_CSV = &h0008 ! fetch row into CSV format string define FETCHR_ROWMAP = &h0010 ! fetch row into ordmap define FETCHR_ORGNAME = &h0020 ! for fetch row into ordmap: use org'name=value (instead of name) [117] define FETCHR_TBLNAME = &h0040 ! for fetch row into ordmap: prepend table:name= (or org'table:org'name=) [117] !*** command opflags for SQLOP_PST_BIND [108] define BINDF_MAPFILE = &h0001 ! [108] bind using a MAP file define BINDF_MAPSTR = &h0002 ! [108] bind using one big MAP string define BINDF_LIST1 = &h0004 ! [108] bind using a simple list of variables define BINDF_LIST2 = &h0008 ! [108] bind using a list of var,option pairs !*** errors define SQLERR_BADDBMSID = 1 ! unsupport dbmsid define SQLERR_DBMSERR = 2 ! dbms error - use ASQLOP_GETERRINFO for details define SQLERR_TOOFEW = 3 ! too few params define SQLERR_NOTFOUND = 4 ! image file not found define SQLERR_NOTINITED = 5 ! lib not yet inited define SQLERR_ALREADYINITED = 6 ! lib already inited define SQLERR_TOOMANY = 7 ! exceeded max # connections supported define SQLERR_NOMEM = 8 ! can't malloc (or out of malloc hdls) define SQLERR_BADOPCODE = 9 ! no such IMAGE.SBR opcode define SQLERR_BADHANDLE = 10 ! bad HANDLE passed define SQLERR_PERR = 11 ! misc param error define SQLERR_LIBLINK = 12 ! can't dynamically link library define SQLERR_SYNTAX = 13 ! bad syntax in inparm string define SQLERR_NORESULT = 14 ! no query results to process define SQLERR_NOTAVAIL = 15 ! [103] feature not (yet?) available define SQLERR_BADRESULTS = 16 ! [103] result set info inconsistent or corrupt define SQLERR_NOCONN = 17 ! [103] no connection define SQLERR_NOSTMT = 18 ! [104] no statement handle [ODBC] define SQLERR_BADOPTION = 19 ! [104] bad option or flag define SQLERR_BADFIELDTYPE = 20 ! [105] bad (unsupported) field type define SQLERR_BADRESHDL = 21 ! [108] bad result set handle passed define SQLERR_BADSTMTHDL = 22 ! [108] bad statement handle passed define SQLERR_BADSTMTTBL = 23 ! [108] stmt table is corrupt define SQLERR_TOOMANYSTMTS = 24 ! [108] stmt table full define SQLERR_BADBINDSIZE = 25 ! [108] bad size of variable during binding define SQLERR_BADBINDSYNTAX = 26 ! [108] bad syntax during binding define SQLERR_BADBINDTYPE = 27 ! [108] bad variable binding type define SQLERR_TOOMANYRESHDLS= 28 ! [111] result set tbl full define SQLERR_NESTIGNORE = 29 ! [112] nested CLOSE_LIB ignored DEFSTRUCT ST_SQL_CMDHDR ! XCALL SQL CMDHDR structure map2 handle,b,1 ! [in/out] handle to connection map2 dbmsconid,b,1 ! [in] 0=ODBC, 1=MySQL, 2=SQL Server, etc [102] was dbmsid map2 dbmsid,b,1,@dbmsconid ! [102] old (deprecated) name map2 opflags,i,2 ! [in] flags modifying (variations of) opcode [104] was b,2 map2 cmdarg1,i,4 ! [in] general purpose argument #1 [104] was b,4 map2 cmdarg2,f,8 ! [in] general purpose argument #2 map2 lastop,b,2 ! [out] last opcode (copied from opcode param) map2 rc,i,2 ! [out] ashsql lib return code - see ASQLERR_xxxx [104] was b,2 map2 rcext,i,4 ! [out] extended error code (dbms err when RC = ASQLERR_DBMSERR) [104] map2 info1,i,4 ! [out] return info [104] was b,4 map2 info2,f,8 ! [out] return info map2 sqlstate,s,5 ! [out] ANSI standard SQL state codes map2 reshdl,b,1 ! [in] result set handle (0-n) (default=0) [107] map2 psthdl,b,1 ! [in/out] prepared statement handle (0=normal stmt; 1-n; -1=next avail) map2 misc,x,5 ! [out] ununsed so far [107] was 7 [108] was 6 ENDSTRUCT DEFSTRUCT ST_SQL_FIELD ! Basic analog to MYSQL_FIELD struct map2 name,s,32 ! field name (or alias) map2 org'name,s,32 ! original field name (no alias) map2 table,s,32 ! table name containing the field (unless calculated) map2 org'table,s,32 ! original name of table (no alias) map2 db,s,32 ! name of database map2 catalog,s,12 ! name of catalog (always "def" for MySQL 5.x) map2 dflt,s,32 ! default value of vield (set only on mysql_list_fields) map2 length,b,4 ! width of field (display width) map2 max'length,b,4 ! max width of actual field data for current result set map2 flags,b,4 ! bit flags describing field - see xxxx_FLAG map2 type,b,4 ! field type enum - see MYSQL_TYPE_xxxx map2 decimals,b,2 ! number of decimals for numeric fields map2 charsetnr,b,2 ! character set/collation ID ENDSTRUCT DEFSTRUCT ST_SQL_DATETIME ! [108] structure matching MySQL TIME (use for raw dates/times) map2 year,b,4 ! year 0000-9999 map2 month,b,4 ! month 1-12 map2 day,b,4 ! day 1-31 map2 hour,b,4 ! hour 0-23 map2 minute,b,4 ! minute 0-59 map2 second,b,4 ! second 0-59 map2 fractions,b,4 ! ? map2 neg,b,1 ! (bool) 0=positive, else negative map2 fill,x,3 map2 type,i,2 ! see SQL_TIMESTAMP_xxx map2 fill2,x,2 ENDSTRUCT ! flag values used in ST_SQL_DATETIME [108] define ASQL_TIMESTAMP_NONE = -2 define ASQL_TIMESTAMP_ERROR = -1 define ASQL_TIMESTAMP_DATE = 0 define ASQL_TIMESTAMP_DATETIME = 1 define ASQL_TIMESTAMP_TIME = 2 !*** field types (from MySQL) define ASQL_TYPE_DECIMAL = 0 ! DECIMAL or NUMERIC define ASQL_TYPE_TINY = 1 ! TINYINT define ASQL_TYPE_SHORT = 2 ! SMALLINT define ASQL_TYPE_LONG = 3 ! INTEGER define ASQL_TYPE_FLOAT = 4 ! FLOAT define ASQL_TYPE_DOUBLE = 5 ! DOUBLE define ASQL_TYPE_NULL = 6 ! NULL-type field define ASQL_TYPE_TIMESTAMP = 7 ! TIMESTAMP define ASQL_TYPE_LONGLONG = 8 ! BIGINT define ASQL_TYPE_INT24 = 9 ! MEDIUMINT define ASQL_TYPE_BIT = 16 ! BIT [103] was 15 define ASQL_TYPE_DATE = 10 ! DATE define ASQL_TYPE_TIME = 11 ! TIME define ASQL_TYPE_DATETIME = 12 ! DATETIME define ASQL_TYPE_YEAR = 13 ! YEAR define ASQL_TYPE_NEWDATE = 14 ! NEW DATE? [103] define ASQL_TYPE_VARCHAR = 15 ! VARCHAR [103] was 14 define ASQL_TYPE_NEWDECIMAL = 246 ! precision math DECIMAL or NUMERIC define ASQL_TYPE_ENUM = 247 ! ENUM define ASQL_TYPE_SET = 248 ! SET define ASQL_TYPE_TINY_BLOB = 249 ! TINY BLOB [103] define ASQL_TYPE_MEDIUM_BLOB = 250 ! MEDIUM BLOB [103] define ASQL_TYPE_LONG_BLOB = 251 ! LONG BLOB [103] define ASQL_TYPE_BLOB = 252 ! BLOB or TEXT (see max'length) define ASQL_TYPE_VAR_STRING = 253 ! VARCHAR or VARBINARY define ASQL_TYPE_STRING = 254 ! CHAR or BINARY define ASQL_TYPE_GEOMETRY = 255 ! spatial !*** field flags define NOT_NULL_FLAG = &h0001 ! field can't be null define PRI_KEY_FLAG = &h0002 ! field is part of primary key define UNIQUE_KEY_FLAG = &h0004 ! field is part of unique key define MULTIPLE_KEY_FLAG = &h0008 ! fieldis part of non-unique key define UNSIGNED_FLAG = &h0020 ! field has the UNSIGNED attribute define ZEROFILL_FLAG = &h0040 ! field has the ZEROFILL attribute define BINARY_FLAG = &h0080 ! field has the BINARY attribute define AUTO_INCREMENT_FLAG = &h0200 ! field has the AUTO_INCREMENT attribute define ENUM_FLAG = &h0100 ! field is an ENUM (deprecated - use MYSQL_TYPE_ENUM) define SET_FLAG = &h0800 ! field is a SET (deprecated - use MYSQL_TYPE_SET) define BLOB_FLAG = &h0010 ! field is a BLOB or TEXT (deprecated - use MYSQL_TYPE_BLOB) define TIMESTAMP_FLAG = &h0400 ! field is a TIMESTAMP (deprecated - use MYSQL_TYPE_TIMESTAMP) define NO_DEFAULT_VALUE_FLAG= &h1000 ! field has no default value define NUM_FLAG = &h8000 ! field is numeric define SQLF_NOT_NULL = &h0001 ! field can't be null define SQLF_PRI_KEY = &h0002 ! field is part of primary key define SQLF_UNIQUE_KEY = &h0004 ! field is part of unique key define SQLF_MULTIPLE_KEY = &h0008 ! fieldis part of non-unique key define SQLF_UNSIGNED = &h0020 ! field has the UNSIGNED attribute define SQLF_ZEROFILL = &h0040 ! field has the ZEROFILL attribute define SQLF_BINARY = &h0080 ! field has the BINARY attribute define SQLF_AUTO_INCREMENT = &h0200 ! field has the AUTO_INCREMENT attribute define SQLF_ENUM = &h0100 ! field is an ENUM (deprecated - use MYSQL_TYPE_ENUM) define SQLF_SET = &h0800 ! field is a SET (deprecated - use MYSQL_TYPE_SET) define SQLF_BLOB = &h0010 ! field is a BLOB or TEXT (deprecated - use MYSQL_TYPE_BLOB) define SQLF_TIMESTAMP = &h0400 ! field is a TIMESTAMP (deprecated - use MYSQL_TYPE_TIMESTAMP) define SQLF_NO_DEFAULT_VALUE= &h1000 ! field has no default value define SQLF_NUM = &h8000 ! field is numeric ![103] MySQL options flags (SQLOP_OPTIONS) ![103] "arg3" refers to 3rd XCALL arg ("optionstring" in doc); define OPT_MY_CONNECT_TIMEOUT = 0 ! arg3 contains timeout in secs define OPT_MY_COMPRESS = 1 ! enable compressed client/server protocol (no args) define OPT_MY_NAMED_PIPE = 2 ! use named pipes to connect to a MySQL server on Windows (no args) define OPT_MY_INIT_COMMAND = 3 ! arg3 = statement to exec on connect/reconnect define OPT_MY_READ_DFT_FILE = 4 ! arg3 = filespec of option file (instead of my.cnf) define OPT_MY_READ_DFT_GROUP = 5 ! arg3 = group name for which to read options define OPT_MY_SET_CHARSET_DIR = 6 ! arg3 = path containing character set definition files define OPT_MY_SET_CHARSET_NAME = 7 ! arg3 = name of char set define OPT_MY_LOCAL_INFILE = 8 ! if arg3 = 1, enaable "LOAD LOCAL INFILE" statement define OPT_MY_PROTOCOL = 9 ! arg3 = protocol (see MYPROTO_xxx) define OPT_MY_READ_TIMEOUT = 11 ! arg3 = timeout in secs for read attempts (x3 retries) define OPT_MY_REPORT_TRUNCATION = 19 ! define OPT_MY_WRITE_TIMEOUT = 12 ! arg3 = timeout in secs for writes (x3 retries) define OPT_MY_SECURE_AUTH = 18 ! if arg3<>0, enable conn to svrs not supporting password hashing define OPT_MY_RECONNECT = 20 ! if arg3<>0, enable auto reconnect (if conn dropped) define OPT_MY_VERIFY_SERVER_CERT= 21 ! if arg3<>0, enable verification of svr's cert ![103] MySQL protocol symbols used with OPT_MY_PROTOCOL (in SQLOP_OPTIONS) define MYPROTO_DEFAULT = 0 ! default define MYPROTO_TCP = 1 ! TCP define MYPROTO_SOCKET = 2 ! socket define MYPROTO_PIPE = 3 ! pipe define MYPROTO_MEMORY = 4 ! memory !=== [ODBC-related symbols] ======================================================== !*** opflags for SQLOP_SET_CONNATR define SQL_ATTR_ACCESS_MODE = 101 ! see SQL_MODE_xxx define SQL_ATTR_ASYNC_ENABLE = 4 define SQL_ATTR_AUTOCOMMIT = 102 define SQL_ATTR_CONNECTION_DEAD = 1209 define SQL_ATTR_CONNECTION_TIMEOUT = 113 define SQL_ATTR_LOGIN_TIMEOUT = 103 define SQL_ATTR_METADATA_ID = 10014 define SQL_ATTR_ODBC_CURSORS = 110 define SQL_ATTR_PACKET_SIZE = 112 define SQL_ATTR_QUIET_MODE = 111 define SQL_ATTR_TRACE = 104 define SQL_ATTR_TRACEFILE = 105 define SQL_ATTR_TRANSLATE_LIB = 106 define SQL_ATTR_TRANSLATE_OPTION = 107 define SQL_ATTR_TXN_ISOLATION = 108 define SQL_ATTR_CURRENT_CATALOG = 109 !*** opflags for SQLOP_SET_STMATR define SQL_ATTR_PARAM_BIND_TYPE = 18 define SQL_ATTR_PARAM_OPERATION_PTR = 19 define SQL_ATTR_PARAM_STATUS_PTR = 20 define SQL_ATTR_PARAMS_PROCESSED_PTR = 21 define SQL_ATTR_PARAMSET_SIZE = 22 define SQL_ATTR_ROW_ARRAY_SIZE = 27 define SQL_ATTR_ROW_BIND_TYPE = 5 define SQL_ATTR_ROW_OPERATION_PTR = 24 define SQL_ATTR_ROW_STATUS_PTR = 25 define SQL_ATTR_ROWS_FETCHED_PTR = 26 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_METADATA_ID = 10014 define SQL_ATTR_CURSOR_SCROLLABLE = -1 define SQL_ATTR_CURSOR_SENSITIVITY = -2 define SQL_ATTR_ASYNC_ENABLE = 4 define SQL_ATTR_CONCURRENCY = 7 define SQL_ATTR_CURSOR_TYPE = 6 define SQL_ATTR_ENABLE_AUTO_IPD = 15 define SQL_ATTR_FETCH_BOOKMARK_PTR = 16 define SQL_ATTR_KEYSET_SIZE = 8 define SQL_ATTR_MAX_LENGTH = 3 define SQL_ATTR_MAX_ROWS = 1 define SQL_ATTR_NOSCAN = 2 define SQL_ATTR_QUERY_TIMEOUT = 0 define SQL_ATTR_RETRIEVE_DATA = 11 define SQL_ATTR_ROW_BIND_OFFSET_PTR = 23 define SQL_ATTR_ROW_NUMBER = 14 ! Get only define SQL_ATTR_ROWS_FETCHED_PTR = 26 define SQL_ATTR_SIMULATE_CURSOR = 10 define SQL_ATTR_USE_BOOKMARKS = 12 ![103] symbols used in SQLOP_?ET_CONNATR values define SQL_MODE_READ_WRITE = 0 ! SQL_ACCESS_MODE options (default) define SQL_MODE_READ_ONLY = 1 ![103] symbols used in SQLOP_?ET_STMATR values: define SQL_ASYNC_ENABLE_OFF = 0 ! SQL_ATTR_ASYNC_ENABLE define SQL_ASYNC_ENABLE_ON = 1 ! " define SQL_CONCUR_READ_ONLY = 1 ! SQL_ATTR_CONCURRENCY: define SQL_CONCUR_LOCK = 2 ! " define SQL_CONCUR_ROWVER = 3 ! " define SQL_CONCUR_VALUES = 4 ! define SQL_NONSCROLLABLE = 0 ! SQL_ATTR_CURSOR_SCROLLABLE define SQL_SCROLLABLE = 1 define SQL_UNSPECIFIED = 0 ! SQL_ATTR_CURSOR_SENSITIVITY define SQL_INSENSITIVE = 1 define SQL_SENSITIVE = 2 define SQL_CURSOR_FORWARD_ONLY = 0 ! SQL_ATTR_CURSOR_TYPE define SQL_CURSOR_KEYSET_DRIVEN = 1 define SQL_CURSOR_DYNAMIC = 2 define SQL_CURSOR_STATIC = 3 define SQL_CURSOR_TYPE_DEFAULT = SQL_CURSOR_FORWARD_ONLY define SQL_BIND_BY_COLUMN = 0 ! SQL_ATTR_ROW_BIND_TYPE ! (else length of buffer for row binding) define SQL_VALUE_ON = 0 ! generic on/off symbols for many params define SQL_VALUE_OFF = 1 define SQL_FALSE = 0 define SQL_TRUE = 1 define SQL_NOSCAN_OFF = 0 ! SQL_ATTR_NOSCAN (default) define SQL_NOSCAN_ON = 1 define SQL_SC_NON_UNIQUE = 0 ! SQL_ATTR_SIMULATE_CURSOR (default) define SQL_SC_TRY_UNIQUE = 1 define SQL_SC_UNIQUE = 2 define SQL_UB_OFF = 0 ! SQL_ATTR_USE_BOOKMARKS (default_ define SQL_UB_FIXED = 1 ! use fixed length bookmarks define SQL_UB_VARIABLE = 2 ! use variable length bookmarks ! FREE_RESULT flags [104] define SQL_CLOSE = 0 ! close result set define SQL_DROP = 1 ! deallocate all statement resources [ODBC] define SQL_UNBIND = 2 ! unbind but retain statement handle [ODBC] define SQL_RESET_PARAMS = 3 ! reset stmt attribs and params [ODBC] ! rcext ODBC values define SQL_SUCCESS = 0 define SQL_SUCCESS_WITH_INFO = 1 define SQL_NO_DATA = 100 define SQL_ERROR = -1 define SQL_INVALID_HANDLE = -2 define SQL_STILL_EXECUTING = 2 define SQL_NEED_DATA = 99 !SQLOP_DATA_SOURCES opflags define SQL_FETCH_NEXT = 1 ! fetch next define SQL_FETCH_FIRST = 2 ! fetch from beginning of list define SQL_FETCH_FIRST_USER = 31 ! fetch first user DSN define SQL_FETCH_FIRST_SYSTEM= 32 ! fetch first system DSN ++endif