src/db_connector/odbcsql

Search:

Consts

SQL_ADD = 4
SQL_ARD_TYPE = -99
SQL_ASYNC_MODE = 10021
SQL_BIGINT = -5
SQL_BINARY = -2
SQL_BIT = -7
SQL_BP_CLOSE = 0x00000001
SQL_BP_DELETE = 0x00000002
SQL_BP_DROP = 0x00000004
SQL_BP_OTHER_HSTMT = 0x00000020
SQL_BP_SCROLL = 0x00000040
SQL_BP_TRANSACTION = 0x00000008
SQL_BP_UPDATE = 0x00000010
SQL_C_BIT = -7
SQL_C_GUID = -11
SQL_C_SLONG = -16
SQL_C_SSHORT = -15
SQL_C_TIME = 10
SQL_C_ULONG = -18
SQL_C_USHORT = -17
SQL_CA1_BULK_ADD = 0x00010000
SQL_CA1_LOCK_EXCLUSIVE = 0x00000080
SQL_CA1_LOCK_NO_CHANGE = 0x00000040
SQL_CA1_LOCK_UNLOCK = 0x00000100
SQL_CA1_POS_DELETE = 0x00000800
SQL_CA1_POS_POSITION = 0x00000200
SQL_CA1_POS_REFRESH = 0x00001000
SQL_CA1_POS_UPDATE = 0x00000400
SQL_CA2_CRC_EXACT = 0x00001000
SQL_CHAR = 1
SQL_CLOSE = 0
SQL_DATE = 9
SQL_DESC_NAME = 1011
SQL_DESC_TYPE = 1002
SQL_DROP = 1
SQL_ERROR = -1
SQL_FALSE = 0
SQL_FLOAT = 6
SQL_GUID = -11
SQL_NAME_LEN = 128
SQL_NO_DATA = 100
SQL_NTS = -3
SQL_QUICK = 0
SQL_REAL = 7
SQL_SO_DYNAMIC = 0x00000004
SQL_SO_FORWARD_ONLY = 0x00000001
SQL_SO_KEYSET_DRIVEN = 0x00000002
SQL_SO_MIXED = 0x00000008
SQL_SO_STATIC = 0x00000010
SQL_TIME = 10
SQL_TRUE = 1
SQL_UB_ON = 1
SQL_WCHAR = -8

Procs

proc SQLAllocHandle(HandleType: TSqlSmallInt; InputHandle: SqlHandle;
                    OutputHandlePtr: var SqlHandle): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLBindCol(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                TargetType: TSqlSmallInt; TargetValue: SqlPointer;
                BufferLength: TSqlLen; StrLen_or_Ind: PSQLINTEGER): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLBindParameter(hstmt: SqlHStmt; ipar: SqlUSmallInt;
                      fParamType: TSqlSmallInt; fCType: TSqlSmallInt;
                      fSqlType: TSqlSmallInt; cbColDef: TSqlULen;
                      ibScale: TSqlSmallInt; rgbValue: SqlPointer;
                      cbValueMax: TSqlLen; pcbValue: var TSqlLen): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLBrowseConnect(hdbc: SqlHDBC; szConnStrIn: PSQLCHAR;
                      cbConnStrIn: TSqlSmallInt; szConnStrOut: PSQLCHAR;
                      cbConnStrOutMax: TSqlSmallInt;
                      cbConnStrOut: var TSqlSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLBulkOperations(StatementHandle: SqlHStmt; Operation: SqlUSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLCloseCursor(StatementHandle: SqlHStmt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLColAttribute(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                     FieldIdentifier: SqlUSmallInt;
                     CharacterAttribute: PSQLCHAR; BufferLength: TSqlSmallInt;
                     StringLength: PSQLSMALLINT; NumericAttribute: TSqlLen): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLColumns(hstmt: SqlHStmt; szTableQualifier: PSQLCHAR;
                cbTableQualifier: TSqlSmallInt; szTableOwner: PSQLCHAR;
                cbTableOwner: TSqlSmallInt; szTableName: PSQLCHAR;
                cbTableName: TSqlSmallInt; szColumnName: PSQLCHAR;
                cbColumnName: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLConnect(ConnectionHandle: SqlHDBC; ServerName: PSQLCHAR;
                NameLength1: TSqlSmallInt; UserName: PSQLCHAR;
                NameLength2: TSqlSmallInt; Authentication: PSQLCHAR;
                NameLength3: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLDataSources(EnvironmentHandle: SqlHEnv; Direction: SqlUSmallInt;
                    ServerName: PSQLCHAR; BufferLength1: TSqlSmallInt;
                    NameLength1: PSQLSMALLINT; Description: PSQLCHAR;
                    BufferLength2: TSqlSmallInt; NameLength2: PSQLSMALLINT): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLDescribeCol(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                    ColumnName: PSQLCHAR; BufferLength: TSqlSmallInt;
                    NameLength: var TSqlSmallInt; DataType: var TSqlSmallInt;
                    ColumnSize: var TSqlULen; DecimalDigits: var TSqlSmallInt;
                    Nullable: var TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLDisconnect(ConnectionHandle: SqlHDBC): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLDriverConnect(hdbc: SqlHDBC; hwnd: SqlHWND; szCsin: cstring;
                      szCLen: TSqlSmallInt; szCsout: cstring;
                      cbCSMax: TSqlSmallInt; cbCsOut: var TSqlSmallInt;
                      f: SqlUSmallInt): TSqlSmallInt {.dynlib: odbclib, importc,
    ...raises: [], tags: [], forbids: [].}
proc SQLDrivers(EnvironmentHandle: SqlHEnv; Direction: SqlUSmallInt;
                DriverDescription: PSQLCHAR; BufferLength1: TSqlSmallInt;
                DescriptionLength1: PSQLSMALLINT; DriverAttributes: PSQLCHAR;
                BufferLength2: TSqlSmallInt; AttributesLength2: PSQLSMALLINT): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLEndTran(HandleType: TSqlSmallInt; Handle: SqlHandle;
                CompletionType: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLErr(henv: SqlHEnv; hdbc: SqlHDBC; hstmt: SqlHStmt;
            szSqlState, pfNativeError, szErrorMsg: PSQLCHAR;
            cbErrorMsgMax: TSqlSmallInt; pcbErrorMsg: PSQLSMALLINT): TSqlSmallInt {.
    dynlib: odbclib, importc: "SQLError", ...raises: [], tags: [], forbids: [].}
proc SQLExecDirect(StatementHandle: SqlHStmt; StatementText: PSQLCHAR;
                   TextLength: TSqlInteger): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLExecDirectW(StatementHandle: SqlHStmt; StatementText: WideCString;
                    TextLength: TSqlInteger): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLExecute(StatementHandle: SqlHStmt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLExtendedFetch(hstmt: SqlHStmt; fFetchType: SqlUSmallInt; irow: TSqlLen;
                      pcrow: var TSqlULen; rgfRowStatus: PSQLUSMALLINT): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLFetch(StatementHandle: SqlHStmt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLFetchScroll(StatementHandle: SqlHStmt; FetchOrientation: TSqlSmallInt;
                    FetchOffset: TSqlLen): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLFreeHandle(HandleType: TSqlSmallInt; Handle: SqlHandle): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLFreeStmt(StatementHandle: SqlHStmt; Option: SqlUSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetCursorName(StatementHandle: SqlHStmt; CursorName: PSQLCHAR;
                      BufferLength: TSqlSmallInt; NameLength: PSQLSMALLINT): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetData(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                TargetType: TSqlSmallInt; TargetValue: SqlPointer;
                BufferLength: TSqlLen; StrLen_or_Ind: ptr TSqlLen): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetDiagField(HandleType: TSqlSmallInt; Handle: SqlHandle;
                     RecNumber: TSqlSmallInt; DiagIdentifier: TSqlSmallInt;
                     DiagInfoPtr: SqlPointer; BufferLength: TSqlSmallInt;
                     StringLengthPtr: var TSqlSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetDiagRec(HandleType: TSqlSmallInt; Handle: SqlHandle;
                   RecNumber: TSqlSmallInt; Sqlstate: PSQLCHAR;
                   NativeError: var TSqlInteger; MessageText: PSQLCHAR;
                   BufferLength: TSqlSmallInt; TextLength: var TSqlSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetEnvAttr(EnvironmentHandle: SqlHEnv; Attribute: TSqlInteger;
                   Value: SqlPointer; BufferLength: TSqlInteger;
                   StringLength: PSQLINTEGER): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetInfo(ConnectionHandle: SqlHDBC; InfoType: SqlUSmallInt;
                InfoValue: SqlPointer; BufferLength: TSqlSmallInt;
                StringLength: PSQLSMALLINT): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLGetStmtAttr(StatementHandle: SqlHStmt; Attribute: TSqlInteger;
                    Value: SqlPointer; BufferLength: TSqlInteger;
                    StringLength: PSQLINTEGER): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLNumResultCols(StatementHandle: SqlHStmt; ColumnCount: var TSqlSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLPrepare(StatementHandle: SqlHStmt; StatementText: PSQLCHAR;
                TextLength: TSqlInteger): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLPrepareW(StatementHandle: SqlHStmt; StatementText: WideCString;
                 TextLength: TSqlInteger): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLPrimaryKeys(hstmt: SqlHStmt; CatalogName: PSQLCHAR;
                    NameLength1: TSqlSmallInt; SchemaName: PSQLCHAR;
                    NameLength2: TSqlSmallInt; TableName: PSQLCHAR;
                    NameLength3: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLProcedureColumns(hstmt: SqlHStmt; CatalogName: PSQLCHAR;
                         NameLength1: TSqlSmallInt; SchemaName: PSQLCHAR;
                         NameLength2: TSqlSmallInt; ProcName: PSQLCHAR;
                         NameLength3: TSqlSmallInt; ColumnName: PSQLCHAR;
                         NameLength4: TSqlSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLProcedures(hstmt: SqlHStmt; szTableQualifier: PSQLCHAR;
                   cbTableQualifier: TSqlSmallInt; szTableOwner: PSQLCHAR;
                   cbTableOwner: TSqlSmallInt; szTableName: PSQLCHAR;
                   cbTableName: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLPutData(StatementHandle: SqlHStmt; Data: SqlPointer;
                StrLen_or_Ind: TSqlLen): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLRowCount(StatementHandle: SqlHStmt; RowCount: var TSqlLen): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLSetConnectAttr(ConnectionHandle: SqlHDBC; Attribute: TSqlInteger;
                       Value: SqlPointer; StringLength: TSqlInteger): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLSetCursorName(StatementHandle: SqlHStmt; CursorName: PSQLCHAR;
                      NameLength: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLSetEnvAttr(EnvironmentHandle: SqlHEnv; Attribute: TSqlInteger;
                   Value: SqlPointer; StringLength: TSqlInteger): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLSetPos(hstmt: SqlHStmt; irow: SqlUSmallInt; fOption: SqlUSmallInt;
               fLock: SqlUSmallInt): TSqlSmallInt {.dynlib: odbclib, importc,
    ...raises: [], tags: [], forbids: [].}
proc SQLSetStmtAttr(StatementHandle: SqlHStmt; Attribute: TSqlInteger;
                    Value: SqlPointer; StringLength: TSqlInteger): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLSpecialColumns(StatementHandle: SqlHStmt; IdentifierType: SqlUSmallInt;
                       CatalogName: PSQLCHAR; NameLength1: TSqlSmallInt;
                       SchemaName: PSQLCHAR; NameLength2: TSqlSmallInt;
                       TableName: PSQLCHAR; NameLength3: TSqlSmallInt;
                       Scope: SqlUSmallInt; Nullable: SqlUSmallInt): TSqlSmallInt {.
    dynlib: odbclib, importc, ...raises: [], tags: [], forbids: [].}
proc SQLStatistics(hstmt: SqlHStmt; CatalogName: PSQLCHAR;
                   NameLength1: TSqlSmallInt; SchemaName: PSQLCHAR;
                   NameLength2: TSqlSmallInt; TableName: PSQLCHAR;
                   NameLength3: TSqlSmallInt; Unique: SqlUSmallInt;
                   Reserved: SqlUSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}
proc SQLTables(hstmt: SqlHStmt; szTableQualifier: PSQLCHAR;
               cbTableQualifier: TSqlSmallInt; szTableOwner: PSQLCHAR;
               cbTableOwner: TSqlSmallInt; szTableName: PSQLCHAR;
               cbTableName: TSqlSmallInt; szTableType: PSQLCHAR;
               cbTableType: TSqlSmallInt): TSqlSmallInt {.dynlib: odbclib,
    importc, ...raises: [], tags: [], forbids: [].}