NCBI C++ ToolKit
Macros | Functions
odbc.c File Reference
#include <config.h>
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <freetds/odbc.h>
#include <freetds/iconv.h>
#include <freetds/string.h>
#include <freetds/convert.h>
#include "replacements.h"
#include "sqlwparams.h"
#include <odbcss.h>
#include "odbc_export.h"
+ Include dependency graph for odbc.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define TDSODBC_BCP
 
#define SQLSetConnectAttr(h, n, p, t)   _SQLSetConnectAttr(h, n, p, t _wide0)
 
#define IRD_CHECK
 
#define INIT_HANDLE(t, n)
 
#define ODBC_ENTER_HSTMT   INIT_HANDLE(STMT, stmt)
 
#define ODBC_ENTER_HDBC   INIT_HANDLE(DBC, dbc)
 
#define ODBC_ENTER_HENV   INIT_HANDLE(ENV, env)
 
#define ODBC_ENTER_HDESC   INIT_HANDLE(DESC, desc)
 
#define IS_VALID_LEN(len)   ((len) >= 0 || (len) == SQL_NTS || (len) == SQL_NULL_DATA)
 
#define ODBC_SAFE_ERROR(stmt)
 
#define DEFAULT_QUERY_TIMEOUT   (~((SQLUINTEGER) 0))
 
#define ODBC_PRRET_BUF   char unknown_prret_buf[24]
 
#define odbc_prret(ret)   odbc_prret(ret, unknown_prret_buf, sizeof(unknown_prret_buf))
 
#define IRD_UPDATE(desc, errs, exit)
 
#define COUT(src)   result = odbc_set_string_oct(stmt->dbc, rgbDesc, cbDescMax, pcbDesc, src ? src : "", -1);
 
#define SOUT(src)   result = odbc_set_string_oct(stmt->dbc, rgbDesc, cbDescMax, pcbDesc, tds_dstr_cstr(&src), -1);
 
#define IOUT(type, src)   *pfDesc = src
 
#define DESC_SET_NEED_REPREPARE
 
#define COUT(src)   result = odbc_set_string_oct(desc_get_dbc(desc), Value, BufferLength, StringLength, src, -1);
 
#define SOUT(src)   result = odbc_set_string_oct(desc_get_dbc(desc), Value, BufferLength, StringLength, tds_dstr_cstr(&src), -1);
 
#define IOUT(type, src)   *((type *)Value) = src
 
#define IIN(type, dest)   dest = (type)(TDS_INTPTR)Value
 
#define PIN(type, dest)   dest = (type)Value
 
#define AT_ROW(ptr, type)   (row_offset ? (type*)(((char*)(ptr)) + row_offset) : &ptr[curr_row])
 
#define API_X(n)   if (n >= 0 && n < 100) pfExists[n] = SQL_TRUE;
 
#define API__(n)
 
#define API3X(n)
 
#define API3_(n)
 
#define API_X(n)   case n:
 
#define API__(n)
 
#define API3X(n)
 
#define API3_(n)
 
#define SIVAL   out_len = sizeof(SQLSMALLINT), *((SQLSMALLINT *) rgbInfoValue)
 
#define USIVAL   out_len = sizeof(SQLUSMALLINT), *((SQLUSMALLINT *) rgbInfoValue)
 
#define IVAL   out_len = sizeof(SQLINTEGER), *((SQLINTEGER *) rgbInfoValue)
 
#define UIVAL   out_len = sizeof(SQLUINTEGER), *((SQLUINTEGER *) rgbInfoValue)
 
#define ULVAL   out_len = sizeof(SQLULEN), *((SQLULEN *) rgbInfoValue)
 

Functions

static SQLRETURN _SQLSetConnectAttr (SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength)
 
static SQLRETURN _SQLAllocConnect (SQLHENV henv, SQLHDBC FAR *phdbc)
 
static SQLRETURN _SQLAllocEnv (SQLHENV FAR *phenv, SQLINTEGER odbc_version)
 
static SQLRETURN _SQLAllocStmt (SQLHDBC hdbc, SQLHSTMT FAR *phstmt)
 
static SQLRETURN _SQLAllocDesc (SQLHDBC hdbc, SQLHDESC FAR *phdesc)
 
static SQLRETURN _SQLFreeConnect (SQLHDBC hdbc)
 
static SQLRETURN _SQLFreeEnv (SQLHENV henv)
 
static SQLRETURN _SQLFreeStmt (SQLHSTMT hstmt, SQLUSMALLINT fOption, int force)
 
static SQLRETURN _SQLFreeDesc (SQLHDESC hdesc)
 
static SQLRETURN _SQLExecute (TDS_STMT *stmt)
 
static SQLRETURN _SQLSetStmtAttr (SQLHSTMT hstmt, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength)
 
static SQLRETURN _SQLGetStmtAttr (SQLHSTMT hstmt, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
 
static SQLRETURN _SQLColAttribute (SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT FAR *pcbDesc, SQLLEN FAR *pfDesc _WIDE)
 
static SQLRETURN _SQLFetch (TDS_STMT *stmt, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset)
 
static SQLRETURN odbc_populate_ird (TDS_STMT *stmt)
 
static int odbc_errmsg_handler (const TDSCONTEXT *ctx, TDSSOCKET *tds, TDSMESSAGE *msg)
 
static void odbc_log_unimplemented_type (const char function_name[], int fType)
 Log a useful message about unimplemented options Defying belief, Microsoft defines mutually exclusive options that some ODBC implementations #define as duplicate values (meaning, of course, that they couldn't be implemented in the same function because they're indistinguishable. More...
 
static void odbc_upper_column_names (TDS_STMT *stmt)
 
static void odbc_col_setname (TDS_STMT *stmt, int colpos, const char *name)
 
static SQLRETURN odbc_stat_execute (TDS_STMT *stmt _WIDE, const char *begin, int nparams,...)
 
static SQLRETURN odbc_free_dynamic (TDS_STMT *stmt)
 
static SQLRETURN odbc_free_cursor (TDS_STMT *stmt)
 Close server cursors. More...
 
static SQLRETURN odbc_update_ird (TDS_STMT *stmt, TDS_ERRS *errs)
 
static SQLRETURN odbc_prepare (TDS_STMT *stmt)
 
static SQLSMALLINT odbc_swap_datetime_sql_type (SQLSMALLINT sql_type, int version)
 Change sql datatype to a specific version. More...
 
static int odbc_process_tokens (TDS_STMT *stmt, unsigned flag)
 
static int odbc_lock_statement (TDS_STMT *stmt)
 
static void odbc_unlock_statement (TDS_STMT *stmt)
 
static const char * odbc_prret (SQLRETURN ret, char *unknown, size_t unknown_size)
 
static SQLRETURN change_autocommit (TDS_DBC *dbc, int state)
 
static SQLRETURN change_database (TDS_DBC *dbc, const char *database, size_t database_len)
 
static SQLRETURN change_txn (TDS_DBC *dbc, SQLUINTEGER txn_isolation)
 
static TDS_DBCodbc_get_dbc (TDSSOCKET *tds)
 
static TDS_STMTodbc_get_stmt (TDSSOCKET *tds)
 
static void odbc_env_change (TDSSOCKET *tds, int type, char *oldval, char *newval)
 
static SQLRETURN odbc_connect (TDS_DBC *dbc, TDSLOGIN *login)
 
static SQLRETURN _SQLDriverConnect (SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR *pcbConnStrOut, SQLUSMALLINT fDriverCompletion)
 
static SQLRETURN _SQLColumnPrivileges (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLExtendedFetch (SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLROWOFFSET irow, SQLROWSETSIZE FAR *pcrow, SQLUSMALLINT FAR *rgfRowStatus)
 
static SQLRETURN _SQLForeignKeys (SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName, SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLMoreResults (SQLHSTMT hstmt)
 
static SQLRETURN _SQLNativeSql (SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR *pcbSqlStr)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLNumParams (SQLHSTMT hstmt, SQLSMALLINT FAR *pcpar)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLParamOptions (SQLHSTMT hstmt, SQLULEN crow, SQLULEN FAR *pirow)
 
static SQLRETURN _SQLPrimaryKeys (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName)
 
static SQLRETURN _SQLProcedureColumns (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
 
static SQLRETURN _SQLProcedures (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName)
 
static TDSPARAMINFOodbc_build_update_params (TDS_STMT *stmt, SQLSETPOSIROW n_row)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetPos (SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock)
 
static SQLRETURN _SQLTablePrivileges (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName)
 
static SQLRETURN _SQLBindParameter (SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN FAR *pcbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLBindParameter (SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN FAR *pcbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLBindParam (SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN FAR *pcbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocConnect (SQLHENV henv, SQLHDBC FAR *phdbc)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocEnv (SQLHENV FAR *phenv)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocStmt (SQLHDBC hdbc, SQLHSTMT FAR *phstmt)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLBindCol (SQLHSTMT hstmt, SQLUSMALLINT icol, SQLSMALLINT fCType, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN FAR *pcbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLCancel (SQLHSTMT hstmt)
 
static SQLRETURN _SQLConnect (SQLHDBC hdbc, SQLCHAR *szDSN, SQLSMALLINT cbDSN, SQLCHAR *szUID, SQLSMALLINT cbUID, SQLCHAR *szAuthStr, SQLSMALLINT cbAuthStr)
 
static SQLRETURN _SQLDescribeCol (SQLHSTMT hstmt, SQLUSMALLINT icol, SQLCHAR *szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR *pcbColName, SQLSMALLINT FAR *pfSqlType, SQLULEN FAR *pcbColDef, SQLSMALLINT FAR *pibScale, SQLSMALLINT FAR *pfNullable)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLColAttributes (SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT FAR *pcbDesc, SQLLEN FAR *pfDesc)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLDisconnect (SQLHDBC hdbc)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescRec (SQLHDESC hdesc, SQLSMALLINT nRecordNumber, SQLSMALLINT nType, SQLSMALLINT nSubType, SQLLEN nLength, SQLSMALLINT nPrecision, SQLSMALLINT nScale, SQLPOINTER pData, SQLLEN FAR *pnStringLength, SQLLEN FAR *pnIndicator)
 
static SQLRETURN _SQLGetDescRec (SQLHDESC hdesc, SQLSMALLINT RecordNumber, SQLCHAR *szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR *pcbName, SQLSMALLINT *Type, SQLSMALLINT *SubType, SQLLEN FAR *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
 
static SQLRETURN _SQLGetDescField (SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
 
static SQLRETURN _SQLSetDescField (SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLCopyDesc (SQLHDESC hsrc, SQLHDESC hdesc)
 
static void odbc_unquote (char *buf, size_t buf_len, const char *start, const char *end)
 
static TDSRET odbc_cursor_execute (TDS_STMT *stmt)
 
static TDSHEADERSodbc_init_headers (TDS_STMT *stmt, TDSHEADERS *head)
 
static SQLRETURN _SQLExecDirect (SQLHSTMT hstmt, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStr)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLExecute (SQLHSTMT hstmt)
 
static void odbc_fix_data_type_col (TDS_STMT *stmt, int idx)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLFetch (SQLHSTMT hstmt)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLFreeEnv (SQLHENV henv)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLFreeStmt (SQLHSTMT hstmt, SQLUSMALLINT fOption)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLCloseCursor (SQLHSTMT hstmt)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetStmtOption (SQLHSTMT hstmt, SQLUSMALLINT fOption, SQLPOINTER pvParam)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLNumResultCols (SQLHSTMT hstmt, SQLSMALLINT FAR *pccol)
 
static SQLRETURN _SQLPrepare (SQLHSTMT hstmt, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStr)
 
SQLRETURN _SQLRowCount (SQLHSTMT hstmt, SQLLEN FAR *pcrow)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLRowCount (SQLHSTMT hstmt, SQLLEN FAR *pcrow)
 
static SQLRETURN _SQLSetCursorName (SQLHSTMT hstmt, SQLCHAR *szCursor, SQLSMALLINT cbCursor)
 
static SQLRETURN _SQLGetCursorName (SQLHSTMT hstmt, SQLCHAR *szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR *pcbCursor)
 
static SQLRETURN change_transaction (TDS_DBC *dbc, int state)
 
static SQLRETURN _SQLTransact (SQLHENV henv, SQLHDBC hdbc, SQLUSMALLINT fType)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLTransact (SQLHENV henv, SQLHDBC hdbc, SQLUSMALLINT fType)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetParam (SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbParamDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN FAR *pcbValue)
 
static SQLRETURN _SQLColumns (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
 SQLColumns. More...
 
static SQLRETURN _SQLGetConnectAttr (SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectOption (SQLHDBC hdbc, SQLUSMALLINT fOption, SQLPOINTER pvParam)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetData (SQLHSTMT hstmt, SQLUSMALLINT icol, SQLSMALLINT fCType, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN FAR *pcbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetFunctions (SQLHDBC hdbc, SQLUSMALLINT fFunction, SQLUSMALLINT FAR *pfExists)
 
static SQLRETURN _SQLGetInfo (TDS_DBC *dbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT FAR *pcbInfoValue _WIDE)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetInfo (SQLHDBC hdbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT FAR *pcbInfoValue)
 
static void tds_ascii_strupr (char *s)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetTypeInfo (SQLHSTMT hstmt, SQLSMALLINT fSqlType)
 
static SQLRETURN _SQLParamData (SQLHSTMT hstmt, SQLPOINTER FAR *prgbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLParamData (SQLHSTMT hstmt, SQLPOINTER FAR *prgbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLPutData (SQLHSTMT hstmt, SQLPOINTER rgbValue, SQLLEN cbValue)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectOption (SQLHDBC hdbc, SQLUSMALLINT fOption, SQLULEN vParam)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetStmtOption (SQLHSTMT hstmt, SQLUSMALLINT fOption, SQLULEN vParam)
 
static SQLRETURN _SQLSpecialColumns (SQLHSTMT hstmt, SQLUSMALLINT fColType, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable)
 
static SQLRETURN _SQLStatistics (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy)
 
static SQLRETURN _SQLTables (SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szTableType, SQLSMALLINT cbTableType)
 
static size_t odbc_quote_metadata (TDS_DBC *dbc, char type, char *dest, DSTR *dstr)
 
static TDSPARAMINFOodbc_add_char_param (TDSSOCKET *tds, TDSPARAMINFO *params, const char *name, const char *value, TDS_INT len)
 
static TDSPARAMINFOodbc_add_int_param (TDSSOCKET *tds, TDSPARAMINFO *params, const char *name, int value)
 
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetScrollOptions (SQLHSTMT hstmt, SQLUSMALLINT fConcurrency, SQLLEN crowKeyset, SQLUSMALLINT crowRowset)
 

Macro Definition Documentation

◆ API3_ [1/2]

#define API3_ (   n)

◆ API3_ [2/2]

#define API3_ (   n)

◆ API3X [1/2]

#define API3X (   n)

◆ API3X [2/2]

#define API3X (   n)

◆ API__ [1/2]

#define API__ (   n)

◆ API__ [2/2]

#define API__ (   n)

◆ API_X [1/2]

#define API_X (   n)    if (n >= 0 && n < 100) pfExists[n] = SQL_TRUE;

◆ API_X [2/2]

#define API_X (   n)    case n:

◆ AT_ROW

#define AT_ROW (   ptr,
  type 
)    (row_offset ? (type*)(((char*)(ptr)) + row_offset) : &ptr[curr_row])

◆ COUT [1/2]

#define COUT (   src)    result = odbc_set_string_oct(stmt->dbc, rgbDesc, cbDescMax, pcbDesc, src ? src : "", -1);

◆ COUT [2/2]

#define COUT (   src)    result = odbc_set_string_oct(desc_get_dbc(desc), Value, BufferLength, StringLength, src, -1);

◆ DEFAULT_QUERY_TIMEOUT

#define DEFAULT_QUERY_TIMEOUT   (~((SQLUINTEGER) 0))

Definition at line 119 of file odbc.c.

◆ DESC_SET_NEED_REPREPARE

#define DESC_SET_NEED_REPREPARE
Value:
do {\
if (desc->type == DESC_IPD) {\
assert(IS_HSTMT(desc->parent));\
((TDS_STMT *) desc->parent)->need_reprepare = 1;\
}\
} while(0)
#define IS_HSTMT(x)
Definition: odbc.h:456
#define DESC_IPD
Definition: odbc.h:220
Definition: odbc.h:390

Definition at line 2419 of file odbc.c.

◆ IIN

#define IIN (   type,
  dest 
)    dest = (type)(TDS_INTPTR)Value

◆ INIT_HANDLE

#define INIT_HANDLE (   t,
  n 
)
Value:
TDS_##t *n = (TDS_##t*)h##n; \
if (SQL_NULL_H##t == h##n || !IS_H##t(h##n)) return SQL_INVALID_HANDLE; \
tds_mutex_lock(&n->mtx); \
CHECK_##t##_EXTRA(n); \
odbc_errs_reset(&n->errs);
yy_size_t n
EIPRangeType t
Definition: ncbi_localip.c:101
#define SQL_INVALID_HANDLE
Definition: sql.h:37

Definition at line 99 of file odbc.c.

◆ IOUT [1/2]

#define IOUT (   type,
  src 
)    *pfDesc = src

◆ IOUT [2/2]

#define IOUT (   type,
  src 
)    *((type *)Value) = src

◆ IRD_CHECK

#define IRD_CHECK

Definition at line 89 of file odbc.c.

◆ IRD_UPDATE

#define IRD_UPDATE (   desc,
  errs,
  exit 
)
Value:
do { \
if (desc->type == DESC_IRD && ((TDS_STMT*)desc->parent)->need_reprepare && \
odbc_update_ird((TDS_STMT*)desc->parent, errs) != SQL_SUCCESS) \
exit; \
} while(0)
#define DESC_IRD
Definition: odbc.h:219
static SQLRETURN odbc_update_ird(TDS_STMT *stmt, TDS_ERRS *errs)
Definition: odbc.c:444
#define SQL_SUCCESS
Definition: sql.h:31

Definition at line 1377 of file odbc.c.

◆ IS_VALID_LEN

#define IS_VALID_LEN (   len)    ((len) >= 0 || (len) == SQL_NTS || (len) == SQL_NULL_DATA)

Definition at line 111 of file odbc.c.

◆ IVAL

#define IVAL   out_len = sizeof(SQLINTEGER), *((SQLINTEGER *) rgbInfoValue)

◆ ODBC_ENTER_HDBC

#define ODBC_ENTER_HDBC   INIT_HANDLE(DBC, dbc)

Definition at line 107 of file odbc.c.

◆ ODBC_ENTER_HDESC

#define ODBC_ENTER_HDESC   INIT_HANDLE(DESC, desc)

Definition at line 109 of file odbc.c.

◆ ODBC_ENTER_HENV

#define ODBC_ENTER_HENV   INIT_HANDLE(ENV, env)

Definition at line 108 of file odbc.c.

◆ ODBC_ENTER_HSTMT

#define ODBC_ENTER_HSTMT   INIT_HANDLE(STMT, stmt)

Definition at line 106 of file odbc.c.

◆ odbc_prret

#define odbc_prret (   ret)    odbc_prret(ret, unknown_prret_buf, sizeof(unknown_prret_buf))

Definition at line 149 of file odbc.c.

◆ ODBC_PRRET_BUF

#define ODBC_PRRET_BUF   char unknown_prret_buf[24]

Definition at line 148 of file odbc.c.

◆ ODBC_SAFE_ERROR

#define ODBC_SAFE_ERROR (   stmt)
Value:
do { \
if (!stmt->errs.num_errors) \
odbc_errs_add(&stmt->errs, "HY000", "Unknown error"); \
} while(0)
static HSTMT stmt
Definition: rebindpar.c:12

Definition at line 113 of file odbc.c.

◆ PIN

#define PIN (   type,
  dest 
)    dest = (type)Value

◆ SIVAL

#define SIVAL   out_len = sizeof(SQLSMALLINT), *((SQLSMALLINT *) rgbInfoValue)

◆ SOUT [1/2]

#define SOUT (   src)    result = odbc_set_string_oct(stmt->dbc, rgbDesc, cbDescMax, pcbDesc, tds_dstr_cstr(&src), -1);

◆ SOUT [2/2]

#define SOUT (   src)    result = odbc_set_string_oct(desc_get_dbc(desc), Value, BufferLength, StringLength, tds_dstr_cstr(&src), -1);

◆ SQLSetConnectAttr

#define SQLSetConnectAttr (   h,
  n,
  p,
  t 
)    _SQLSetConnectAttr(h, n, p, t _wide0)

Definition at line 50 of file odbc.c.

◆ TDSODBC_BCP

#define TDSODBC_BCP

Definition at line 48 of file odbc.c.

◆ UIVAL

#define UIVAL   out_len = sizeof(SQLUINTEGER), *((SQLUINTEGER *) rgbInfoValue)

◆ ULVAL

#define ULVAL   out_len = sizeof(SQLULEN), *((SQLULEN *) rgbInfoValue)

◆ USIVAL

#define USIVAL   out_len = sizeof(SQLUSMALLINT), *((SQLUSMALLINT *) rgbInfoValue)

Function Documentation

◆ _SQLAllocConnect()

static SQLRETURN _SQLAllocConnect ( SQLHENV  henv,
SQLHDBC FAR phdbc 
)
static

◆ _SQLAllocDesc()

static SQLRETURN _SQLAllocDesc ( SQLHDBC  hdbc,
SQLHDESC FAR phdesc 
)
static

◆ _SQLAllocEnv()

static SQLRETURN _SQLAllocEnv ( SQLHENV FAR phenv,
SQLINTEGER  odbc_version 
)
static

◆ _SQLAllocStmt()

static SQLRETURN _SQLAllocStmt ( SQLHDBC  hdbc,
SQLHSTMT FAR phstmt 
)
static

◆ _SQLBindParameter()

static SQLRETURN _SQLBindParameter ( SQLHSTMT  hstmt,
SQLUSMALLINT  ipar,
SQLSMALLINT  fParamType,
SQLSMALLINT  fCType,
SQLSMALLINT  fSqlType,
SQLULEN  cbColDef,
SQLSMALLINT  ibScale,
SQLPOINTER  rgbValue,
SQLLEN  cbValueMax,
SQLLEN FAR pcbValue 
)
static

◆ _SQLColAttribute()

static SQLRETURN _SQLColAttribute ( SQLHSTMT  hstmt,
SQLUSMALLINT  icol,
SQLUSMALLINT  fDescType,
SQLPOINTER  rgbDesc,
SQLSMALLINT  cbDescMax,
SQLSMALLINT FAR pcbDesc,
SQLLEN FAR *pfDesc  _WIDE 
)
static

Definition at line 2047 of file odbc.c.

References COUT, _hdesc::header, IOUT, IRD_UPDATE, NULL, ODBC_ENTER_HSTMT, odbc_errs_add(), ODBC_EXIT, ODBC_EXIT_, _hdesc::records, result, SOUT, SQL_COLUMN_COUNT, SQL_COLUMN_LENGTH, SQL_COLUMN_NAME, SQL_COLUMN_NULLABLE, SQL_COLUMN_PRECISION, SQL_COLUMN_SCALE, SQL_COLUMN_TYPE, SQL_DATE, SQL_DECIMAL, _drecord::sql_desc_auto_unique_value, SQL_DESC_AUTO_UNIQUE_VALUE, _drecord::sql_desc_base_column_name, SQL_DESC_BASE_COLUMN_NAME, _drecord::sql_desc_base_table_name, SQL_DESC_BASE_TABLE_NAME, _drecord::sql_desc_case_sensitive, SQL_DESC_CASE_SENSITIVE, _drecord::sql_desc_catalog_name, SQL_DESC_CATALOG_NAME, _drecord::sql_desc_concise_type, SQL_DESC_CONCISE_TYPE, _dheader::sql_desc_count, SQL_DESC_COUNT, _drecord::sql_desc_display_size, SQL_DESC_DISPLAY_SIZE, _drecord::sql_desc_fixed_prec_scale, SQL_DESC_FIXED_PREC_SCALE, _drecord::sql_desc_label, SQL_DESC_LABEL, _drecord::sql_desc_length, SQL_DESC_LENGTH, _drecord::sql_desc_literal_prefix, SQL_DESC_LITERAL_PREFIX, _drecord::sql_desc_literal_suffix, SQL_DESC_LITERAL_SUFFIX, _drecord::sql_desc_local_type_name, SQL_DESC_LOCAL_TYPE_NAME, _drecord::sql_desc_name, SQL_DESC_NAME, _drecord::sql_desc_nullable, SQL_DESC_NULLABLE, _drecord::sql_desc_num_prec_radix, SQL_DESC_NUM_PREC_RADIX, _drecord::sql_desc_octet_length, SQL_DESC_OCTET_LENGTH, _drecord::sql_desc_precision, SQL_DESC_PRECISION, _drecord::sql_desc_scale, SQL_DESC_SCALE, _drecord::sql_desc_schema_name, SQL_DESC_SCHEMA_NAME, _drecord::sql_desc_searchable, SQL_DESC_SEARCHABLE, _drecord::sql_desc_table_name, SQL_DESC_TABLE_NAME, _drecord::sql_desc_type, SQL_DESC_TYPE, _drecord::sql_desc_type_name, SQL_DESC_TYPE_NAME, _drecord::sql_desc_unnamed, SQL_DESC_UNNAMED, _drecord::sql_desc_unsigned, SQL_DESC_UNSIGNED, _drecord::sql_desc_updatable, SQL_DESC_UPDATABLE, SQL_DOUBLE, SQL_ERROR, SQL_FLOAT, SQL_NUMERIC, SQL_OV_ODBC3, SQL_REAL, SQL_SS_TIME2, SQL_SS_TIMESTAMPOFFSET, SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_TIME, SQL_TIMESTAMP, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQLLEN, SQLULEN, stmt, TDS_DBG_FUNC, TDS_DBG_INFO1, TDS_DBG_INFO2, and tdsdump_log.

Referenced by SQLColAttributes().

◆ _SQLColumnPrivileges()

static SQLRETURN _SQLColumnPrivileges ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName,
SQLCHAR szColumnName,
SQLSMALLINT  cbColumnName 
)
static

◆ _SQLColumns()

static SQLRETURN _SQLColumns ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName,
SQLCHAR szColumnName,
SQLSMALLINT  cbColumnName 
)
static

SQLColumns.

Return column information for a table or view. This is mapped to a call to sp_columns which - lucky for us - returns the exact result set we need.

exec sp_columns [ @table_name = ] object [ , [ @table_owner = ] owner ] [ , [ @table_qualifier = ] qualifier ] [ , [ @column_name = ] column ] [ , [ @ODBCVer = ] ODBCVer ]

Definition at line 4768 of file odbc.c.

References _wide, NULL, odbc_col_setname(), ODBC_ENTER_HSTMT, ODBC_EXIT_, ODBC_SPECIAL_COLUMNS, odbc_stat_execute(), SQL_OV_ODBC3, SQL_SUCCEEDED, stmt, TDS_IS_MSSQL, and TDS_IS_SYBASE.

Referenced by SQLColumns().

◆ _SQLConnect()

static SQLRETURN _SQLConnect ( SQLHDBC  hdbc,
SQLCHAR szDSN,
SQLSMALLINT  cbDSN,
SQLCHAR szUID,
SQLSMALLINT  cbUID,
SQLCHAR szAuthStr,
SQLSMALLINT  cbAuthStr 
)
static

◆ _SQLDescribeCol()

static SQLRETURN _SQLDescribeCol ( SQLHSTMT  hstmt,
SQLUSMALLINT  icol,
SQLCHAR szColName,
SQLSMALLINT  cbColNameMax,
SQLSMALLINT FAR pcbColName,
SQLSMALLINT FAR pfSqlType,
SQLULEN FAR pcbColDef,
SQLSMALLINT FAR pibScale,
SQLSMALLINT FAR pfNullable 
)
static

◆ _SQLDriverConnect()

static SQLRETURN _SQLDriverConnect ( SQLHDBC  hdbc,
SQLHWND  hwnd,
SQLCHAR szConnStrIn,
SQLSMALLINT  cbConnStrIn,
SQLCHAR szConnStrOut,
SQLSMALLINT  cbConnStrOutMax,
SQLSMALLINT FAR pcbConnStrOut,
SQLUSMALLINT  fDriverCompletion 
)
static

◆ _SQLExecDirect()

static SQLRETURN _SQLExecDirect ( SQLHSTMT  hstmt,
SQLCHAR szSqlStr,
SQLINTEGER  cbSqlStr 
)
static

◆ _SQLExecute()

static SQLRETURN _SQLExecute ( TDS_STMT stmt)
static

◆ _SQLFetch()

static SQLRETURN _SQLFetch ( TDS_STMT stmt,
SQLSMALLINT  FetchOrientation,
SQLLEN  FetchOffset 
)
static

Definition at line 3723 of file odbc.c.

References AFTER_COMPUTE_ROW, AT_ROW, tds_column::column_cur_size, tds_column::column_data, tds_column::column_size, tds_column::column_text_sqlgetdatapos, tds_column::column_type, tds_result_info::columns, tds_socket::current_results, tds_cursor::cursor_rows, dummy, _hdesc::header, i, if(), IN_COMPUTE_ROW, IN_NORMAL_ROW, IRD_CHECK, len, NOT_IN_ROW, NULL, tds_result_info::num_cols, odbc_errs_add(), odbc_fix_data_type_col(), odbc_get_octet_len(), odbc_lock_statement(), odbc_populate_ird(), odbc_process_tokens(), ODBC_RETURN, ODBC_RETURN_, ODBC_SAFE_ERROR, ODBC_SPECIAL_COLUMNS, ODBC_SPECIAL_GETTYPEINFO, ODBC_SPECIAL_NONE, ODBC_SPECIAL_PROCEDURECOLUMNS, ODBC_SPECIAL_SPECIALCOLUMNS, odbc_sql_to_c_type_default(), odbc_tds2sql(), odbc_unlock_statement(), tds_column::on_server, PRE_NORMAL_ROW, _hdesc::records, tds_socket::rows_affected, SQL_BIND_BY_COLUMN, SQL_C_BINARY, SQL_C_CHAR, SQL_C_DEFAULT, _dheader::sql_desc_array_size, _drecord::sql_desc_concise_type, _dheader::sql_desc_count, _drecord::sql_desc_data_ptr, _drecord::sql_desc_indicator_ptr, _drecord::sql_desc_octet_length, _drecord::sql_desc_octet_length_ptr, SQL_ERROR, SQL_FETCH_ABSOLUTE, SQL_FETCH_FIRST, SQL_FETCH_LAST, SQL_FETCH_NEXT, SQL_FETCH_PRIOR, SQL_FETCH_RELATIVE, SQL_NO_DATA, SQL_NULL_DATA, SQL_ROW_ERROR, SQL_ROW_NOROW, SQL_ROW_SUCCESS, SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQLLEN, SQLULEN, stmt, tds, TDS_CMD_FAIL, tds_cursor_fetch, TDS_CURSOR_FETCH_ABSOLUTE, TDS_CURSOR_FETCH_FIRST, TDS_CURSOR_FETCH_LAST, TDS_CURSOR_FETCH_NEXT, TDS_CURSOR_FETCH_PREV, TDS_CURSOR_FETCH_RELATIVE, tds_cursor_setrows, TDS_DBG_FUNC, TDS_DBG_INFO1, TDS_FAILED, tds_get_conversion_type, tds_process_tokens, TDS_RETURN_ROW, TDS_ROW_RESULT, TDS_STOPAT_COMPUTE, TDS_STOPAT_ROW, TDS_STOPAT_ROWFMT, TDS_TOKEN_TRAILING, and tdsdump_log.

Referenced by SQLExtendedFetch(), and SQLFetch().

◆ _SQLForeignKeys()

static SQLRETURN _SQLForeignKeys ( SQLHSTMT  hstmt,
SQLCHAR szPkCatalogName,
SQLSMALLINT  cbPkCatalogName,
SQLCHAR szPkSchemaName,
SQLSMALLINT  cbPkSchemaName,
SQLCHAR szPkTableName,
SQLSMALLINT  cbPkTableName,
SQLCHAR szFkCatalogName,
SQLSMALLINT  cbFkCatalogName,
SQLCHAR szFkSchemaName,
SQLSMALLINT  cbFkSchemaName,
SQLCHAR szFkTableName,
SQLSMALLINT  cbFkTableName 
)
static

◆ _SQLFreeConnect()

static SQLRETURN _SQLFreeConnect ( SQLHDBC  hdbc)
static

◆ _SQLFreeDesc()

static SQLRETURN _SQLFreeDesc ( SQLHDESC  hdesc)
static

◆ _SQLFreeEnv()

static SQLRETURN _SQLFreeEnv ( SQLHENV  henv)
static

◆ _SQLFreeStmt()

static SQLRETURN _SQLFreeStmt ( SQLHSTMT  hstmt,
SQLUSMALLINT  fOption,
int  force 
)
static

◆ _SQLGetConnectAttr()

static SQLRETURN _SQLGetConnectAttr ( SQLHDBC  hdbc,
SQLINTEGER  Attribute,
SQLPOINTER  Value,
SQLINTEGER  BufferLength,
SQLINTEGER StringLength 
)
static

◆ _SQLGetCursorName()

static SQLRETURN _SQLGetCursorName ( SQLHSTMT  hstmt,
SQLCHAR szCursor,
SQLSMALLINT  cbCursorMax,
SQLSMALLINT FAR pcbCursor 
)
static

Definition at line 4634 of file odbc.c.

References NULL, ODBC_ENTER_HSTMT, odbc_errs_add(), ODBC_EXIT, odbc_set_string, stmt, and tds_dstr_cstr().

Referenced by SQLGetCursorName().

◆ _SQLGetDescField()

static SQLRETURN _SQLGetDescField ( SQLHDESC  hdesc,
SQLSMALLINT  icol,
SQLSMALLINT  fDescType,
SQLPOINTER  Value,
SQLINTEGER  BufferLength,
SQLINTEGER StringLength 
)
static

Definition at line 2529 of file odbc.c.

References COUT, IOUT, IRD_UPDATE, NULL, ODBC_ENTER_HDESC, odbc_errs_add(), ODBC_EXIT, ODBC_EXIT_, result, SOUT, SQL_DECIMAL, SQL_DESC_ALLOC_TYPE, SQL_DESC_ARRAY_SIZE, SQL_DESC_ARRAY_STATUS_PTR, _drecord::sql_desc_auto_unique_value, SQL_DESC_AUTO_UNIQUE_VALUE, _drecord::sql_desc_base_column_name, SQL_DESC_BASE_COLUMN_NAME, _drecord::sql_desc_base_table_name, SQL_DESC_BASE_TABLE_NAME, SQL_DESC_BIND_OFFSET_PTR, SQL_DESC_BIND_TYPE, _drecord::sql_desc_case_sensitive, SQL_DESC_CASE_SENSITIVE, _drecord::sql_desc_catalog_name, SQL_DESC_CATALOG_NAME, _drecord::sql_desc_concise_type, SQL_DESC_CONCISE_TYPE, SQL_DESC_COUNT, _drecord::sql_desc_data_ptr, SQL_DESC_DATA_PTR, _drecord::sql_desc_datetime_interval_code, SQL_DESC_DATETIME_INTERVAL_CODE, _drecord::sql_desc_datetime_interval_precision, SQL_DESC_DATETIME_INTERVAL_PRECISION, _drecord::sql_desc_display_size, SQL_DESC_DISPLAY_SIZE, _drecord::sql_desc_fixed_prec_scale, SQL_DESC_FIXED_PREC_SCALE, _drecord::sql_desc_indicator_ptr, SQL_DESC_INDICATOR_PTR, _drecord::sql_desc_label, SQL_DESC_LABEL, _drecord::sql_desc_length, SQL_DESC_LENGTH, _drecord::sql_desc_literal_prefix, SQL_DESC_LITERAL_PREFIX, _drecord::sql_desc_literal_suffix, SQL_DESC_LITERAL_SUFFIX, _drecord::sql_desc_local_type_name, SQL_DESC_LOCAL_TYPE_NAME, _drecord::sql_desc_name, SQL_DESC_NAME, _drecord::sql_desc_nullable, SQL_DESC_NULLABLE, _drecord::sql_desc_num_prec_radix, SQL_DESC_NUM_PREC_RADIX, _drecord::sql_desc_octet_length, SQL_DESC_OCTET_LENGTH, _drecord::sql_desc_octet_length_ptr, SQL_DESC_OCTET_LENGTH_PTR, _drecord::sql_desc_parameter_type, SQL_DESC_PARAMETER_TYPE, _drecord::sql_desc_precision, SQL_DESC_PRECISION, SQL_DESC_ROWS_PROCESSED_PTR, _drecord::sql_desc_rowver, SQL_DESC_ROWVER, _drecord::sql_desc_scale, SQL_DESC_SCALE, _drecord::sql_desc_schema_name, SQL_DESC_SCHEMA_NAME, _drecord::sql_desc_searchable, SQL_DESC_SEARCHABLE, _drecord::sql_desc_table_name, SQL_DESC_TABLE_NAME, _drecord::sql_desc_type, SQL_DESC_TYPE, _drecord::sql_desc_type_name, SQL_DESC_TYPE_NAME, _drecord::sql_desc_unnamed, SQL_DESC_UNNAMED, _drecord::sql_desc_unsigned, SQL_DESC_UNSIGNED, _drecord::sql_desc_updatable, SQL_DESC_UPDATABLE, SQL_ERROR, SQL_FLOAT, SQL_NO_DATA, SQL_NUMERIC, SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_TIMESTAMP, SQL_TYPE_TIMESTAMP, SQLLEN, SQLULEN, TDS_DBG_INFO1, and tdsdump_log.

Referenced by SQLGetDescField().

◆ _SQLGetDescRec()

static SQLRETURN _SQLGetDescRec ( SQLHDESC  hdesc,
SQLSMALLINT  RecordNumber,
SQLCHAR szName,
SQLSMALLINT  cbNameMax,
SQLSMALLINT FAR pcbName,
SQLSMALLINT Type,
SQLSMALLINT SubType,
SQLLEN FAR Length,
SQLSMALLINT Precision,
SQLSMALLINT Scale,
SQLSMALLINT Nullable 
)
static

◆ _SQLGetInfo()

static SQLRETURN _SQLGetInfo ( TDS_DBC dbc,
SQLUSMALLINT  fInfoType,
SQLPOINTER  rgbInfoValue,
SQLSMALLINT  cbInfoValueMax,
SQLSMALLINT FAR *pcbInfoValue  _WIDE 
)
static

Definition at line 5143 of file odbc.c.

References buf, tds_socket::conn, dbc, IVAL, NULL, odbc_errs_add(), odbc_log_unimplemented_type(), odbc_rdbms_version(), odbc_set_string_oct, tds_connection::product_name, tds_connection::product_version, SIVAL, SQL_ACCESSIBLE_PROCEDURES, SQL_ACCESSIBLE_TABLES, SQL_ACTIVE_ENVIRONMENTS, SQL_AF_ALL, SQL_AGGREGATE_FUNCTIONS, SQL_ALTER_DOMAIN, SQL_ALTER_TABLE, SQL_AM_NONE, SQL_ASYNC_MODE, SQL_AT_ADD_COLUMN, SQL_AT_ADD_COLUMN_DEFAULT, SQL_AT_ADD_COLUMN_SINGLE, SQL_AT_ADD_CONSTRAINT, SQL_AT_ADD_TABLE_CONSTRAINT, SQL_AT_CONSTRAINT_NAME_DEFINITION, SQL_AT_DROP_COLUMN_RESTRICT, SQL_BATCH_ROW_COUNT, SQL_BATCH_SUPPORT, SQL_BOOKMARK_PERSISTENCE, SQL_BP_DELETE, SQL_BP_SCROLL, SQL_BP_UPDATE, SQL_BRC_EXPLICIT, SQL_BS_ROW_COUNT_EXPLICIT, SQL_BS_ROW_COUNT_PROC, SQL_BS_SELECT_EXPLICIT, SQL_BS_SELECT_PROC, SQL_CA1_ABSOLUTE, SQL_CA1_LOCK_NO_CHANGE, SQL_CA1_NEXT, SQL_CA1_POS_DELETE, SQL_CA1_POS_POSITION, SQL_CA1_POS_UPDATE, SQL_CA1_POSITIONED_DELETE, SQL_CA1_POSITIONED_UPDATE, SQL_CA1_RELATIVE, SQL_CATALOG_LOCATION, SQL_CATALOG_NAME, SQL_CATALOG_NAME_SEPARATOR, SQL_CATALOG_TERM, SQL_CATALOG_USAGE, SQL_CB_CLOSE, SQL_CB_NON_NULL, SQL_CB_NULL, SQL_CL_START, SQL_CN_ANY, SQL_COLLATION_SEQ, SQL_COLUMN_ALIAS, SQL_CONCAT_NULL_BEHAVIOR, SQL_CONVERT_BINARY, SQL_CONVERT_BIT, SQL_CONVERT_CHAR, SQL_CONVERT_DECIMAL, SQL_CONVERT_FLOAT, SQL_CONVERT_FUNCTIONS, SQL_CONVERT_INTEGER, SQL_CONVERT_LONGVARBINARY, SQL_CONVERT_LONGVARCHAR, SQL_CONVERT_NUMERIC, SQL_CONVERT_REAL, SQL_CONVERT_SMALLINT, SQL_CONVERT_TIMESTAMP, SQL_CONVERT_TINYINT, SQL_CONVERT_VARBINARY, SQL_CONVERT_VARCHAR, SQL_CONVERT_WCHAR, SQL_CONVERT_WLONGVARCHAR, SQL_CONVERT_WVARCHAR, SQL_CORRELATION_NAME, SQL_CREATE_ASSERTION, SQL_CREATE_CHARACTER_SET, SQL_CREATE_COLLATION, SQL_CREATE_DOMAIN, SQL_CREATE_SCHEMA, SQL_CREATE_TABLE, SQL_CREATE_TRANSLATION, SQL_CREATE_VIEW, SQL_CS_AUTHORIZATION, SQL_CS_CREATE_SCHEMA, SQL_CT_CREATE_TABLE, SQL_CU_DML_STATEMENTS, SQL_CU_PROCEDURE_INVOCATION, SQL_CU_TABLE_DEFINITION, SQL_CURSOR_COMMIT_BEHAVIOR, SQL_CURSOR_ROLLBACK_BEHAVIOR, SQL_CURSOR_SENSITIVITY, SQL_CV_CHECK_OPTION, SQL_CV_CREATE_VIEW, SQL_CVT_BINARY, SQL_CVT_BIT, SQL_CVT_CHAR, SQL_CVT_DECIMAL, SQL_CVT_FLOAT, SQL_CVT_INTEGER, SQL_CVT_LONGVARBINARY, SQL_CVT_LONGVARCHAR, SQL_CVT_NUMERIC, SQL_CVT_REAL, SQL_CVT_SMALLINT, SQL_CVT_TIMESTAMP, SQL_CVT_TINYINT, SQL_CVT_VARBINARY, SQL_CVT_VARCHAR, SQL_CVT_WCHAR, SQL_CVT_WLONGVARCHAR, SQL_CVT_WVARCHAR, SQL_DATA_SOURCE_NAME, SQL_DATA_SOURCE_READ_ONLY, SQL_DATABASE_NAME, SQL_DATETIME_LITERALS, SQL_DBMS_NAME, SQL_DBMS_VER, SQL_DDL_INDEX, SQL_DEFAULT_TXN_ISOLATION, SQL_DESCRIBE_PARAMETER, SQL_DRIVER_HDBC, SQL_DRIVER_HENV, SQL_DRIVER_HSTMT, SQL_DRIVER_NAME, SQL_DRIVER_ODBC_VER, SQL_DRIVER_VER, SQL_DROP_ASSERTION, SQL_DROP_CHARACTER_SET, SQL_DROP_COLLATION, SQL_DROP_DOMAIN, SQL_DROP_SCHEMA, SQL_DROP_TABLE, SQL_DROP_TRANSLATION, SQL_DROP_VIEW, SQL_DT_DROP_TABLE, SQL_DV_DROP_VIEW, SQL_DYNAMIC_CURSOR_ATTRIBUTES1, SQL_DYNAMIC_CURSOR_ATTRIBUTES2, SQL_ERROR, SQL_EXPRESSIONS_IN_ORDERBY, SQL_FD_FETCH_ABSOLUTE, SQL_FD_FETCH_FIRST, SQL_FD_FETCH_LAST, SQL_FD_FETCH_NEXT, SQL_FD_FETCH_PRIOR, SQL_FD_FETCH_RELATIVE, SQL_FETCH_DIRECTION, SQL_FILE_NOT_SUPPORTED, SQL_FILE_USAGE, SQL_FN_CVT_CAST, SQL_FN_CVT_CONVERT, SQL_FN_NUM_ABS, SQL_FN_NUM_ACOS, SQL_FN_NUM_ASIN, SQL_FN_NUM_ATAN, SQL_FN_NUM_ATAN2, SQL_FN_NUM_CEILING, SQL_FN_NUM_COS, SQL_FN_NUM_COT, SQL_FN_NUM_DEGREES, SQL_FN_NUM_EXP, SQL_FN_NUM_FLOOR, SQL_FN_NUM_LOG, SQL_FN_NUM_LOG10, SQL_FN_NUM_MOD, SQL_FN_NUM_PI, SQL_FN_NUM_POWER, SQL_FN_NUM_RADIANS, SQL_FN_NUM_RAND, SQL_FN_NUM_ROUND, SQL_FN_NUM_SIGN, SQL_FN_NUM_SIN, SQL_FN_NUM_SQRT, SQL_FN_NUM_TAN, SQL_FN_STR_ASCII, SQL_FN_STR_BIT_LENGTH, SQL_FN_STR_CHAR, SQL_FN_STR_CONCAT, SQL_FN_STR_DIFFERENCE, SQL_FN_STR_INSERT, SQL_FN_STR_LCASE, SQL_FN_STR_LEFT, SQL_FN_STR_LENGTH, SQL_FN_STR_LOCATE_2, SQL_FN_STR_LTRIM, SQL_FN_STR_OCTET_LENGTH, SQL_FN_STR_REPEAT, SQL_FN_STR_RIGHT, SQL_FN_STR_RTRIM, SQL_FN_STR_SOUNDEX, SQL_FN_STR_SPACE, SQL_FN_STR_SUBSTRING, SQL_FN_STR_UCASE, SQL_FN_SYS_DBNAME, SQL_FN_SYS_IFNULL, SQL_FN_SYS_USERNAME, SQL_FN_TD_CURDATE, SQL_FN_TD_CURRENT_DATE, SQL_FN_TD_CURRENT_TIME, SQL_FN_TD_CURRENT_TIMESTAMP, SQL_FN_TD_CURTIME, SQL_FN_TD_DAYNAME, SQL_FN_TD_DAYOFMONTH, SQL_FN_TD_DAYOFWEEK, SQL_FN_TD_DAYOFYEAR, SQL_FN_TD_EXTRACT, SQL_FN_TD_HOUR, SQL_FN_TD_MINUTE, SQL_FN_TD_MONTH, SQL_FN_TD_MONTHNAME, SQL_FN_TD_NOW, SQL_FN_TD_QUARTER, SQL_FN_TD_SECOND, SQL_FN_TD_TIMESTAMPADD, SQL_FN_TD_TIMESTAMPDIFF, SQL_FN_TD_WEEK, SQL_FN_TD_YEAR, SQL_FN_TSI_DAY, SQL_FN_TSI_FRAC_SECOND, SQL_FN_TSI_HOUR, SQL_FN_TSI_MINUTE, SQL_FN_TSI_MONTH, SQL_FN_TSI_QUARTER, SQL_FN_TSI_SECOND, SQL_FN_TSI_WEEK, SQL_FN_TSI_YEAR, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, SQL_GB_GROUP_BY_CONTAINS_SELECT, SQL_GD_BLOCK, SQL_GETDATA_EXTENSIONS, SQL_GROUP_BY, SQL_IC_MIXED, SQL_IDENTIFIER_CASE, SQL_IDENTIFIER_QUOTE_CHAR, SQL_IK_ASC, SQL_IK_DESC, SQL_INDEX_KEYWORDS, SQL_INFO_FREETDS_TDS_VERSION, SQL_INFO_SCHEMA_VIEWS, SQL_INSERT_STATEMENT, SQL_INTEGRITY, SQL_KEYSET_CURSOR_ATTRIBUTES1, SQL_KEYSET_CURSOR_ATTRIBUTES2, SQL_KEYWORDS, SQL_LCK_NO_CHANGE, SQL_LIKE_ESCAPE_CLAUSE, SQL_LOCK_TYPES, SQL_MAX_ASYNC_CONCURRENT_STATEMENTS, SQL_MAX_BINARY_LITERAL_LEN, SQL_MAX_CATALOG_NAME_LEN, SQL_MAX_CHAR_LITERAL_LEN, SQL_MAX_COLUMN_NAME_LEN, SQL_MAX_COLUMNS_IN_GROUP_BY, SQL_MAX_COLUMNS_IN_INDEX, SQL_MAX_COLUMNS_IN_ORDER_BY, SQL_MAX_COLUMNS_IN_SELECT, SQL_MAX_COLUMNS_IN_TABLE, SQL_MAX_CONCURRENT_ACTIVITIES, SQL_MAX_CURSOR_NAME_LEN, SQL_MAX_DRIVER_CONNECTIONS, SQL_MAX_IDENTIFIER_LEN, SQL_MAX_INDEX_SIZE, SQL_MAX_PROCEDURE_NAME_LEN, SQL_MAX_ROW_SIZE, SQL_MAX_ROW_SIZE_INCLUDES_LONG, SQL_MAX_SCHEMA_NAME_LEN, SQL_MAX_STATEMENT_LEN, SQL_MAX_TABLE_NAME_LEN, SQL_MAX_TABLES_IN_SELECT, SQL_MAX_USER_NAME_LEN, SQL_MULT_RESULT_SETS, SQL_MULTIPLE_ACTIVE_TXN, SQL_NC_LOW, SQL_NEED_LONG_DATA_LEN, SQL_NNC_NON_NULL, SQL_NON_NULLABLE_COLUMNS, SQL_NULL_COLLATION, SQL_NUMERIC_FUNCTIONS, SQL_OAC_LEVEL2, SQL_ODBC_API_CONFORMANCE, SQL_ODBC_INTERFACE_CONFORMANCE, SQL_ODBC_SAG_CLI_CONFORMANCE, SQL_ODBC_SQL_CONFORMANCE, SQL_ODBC_VER, SQL_OJ_ALL_COMPARISON_OPS, SQL_OJ_CAPABILITIES, SQL_OJ_FULL, SQL_OJ_INNER, SQL_OJ_LEFT, SQL_OJ_NESTED, SQL_OJ_NOT_ORDERED, SQL_OJ_RIGHT, SQL_ORDER_BY_COLUMNS_IN_SELECT, SQL_OSC_CORE, SQL_OSCC_NOT_COMPLIANT, SQL_OU_DML_STATEMENTS, SQL_OU_INDEX_DEFINITION, SQL_OU_PRIVILEGE_DEFINITION, SQL_OU_PROCEDURE_INVOCATION, SQL_OU_TABLE_DEFINITION, SQL_OUTER_JOINS, SQL_PARAM_ARRAY_ROW_COUNTS, SQL_PARAM_ARRAY_SELECTS, SQL_PARC_BATCH, SQL_PAS_BATCH, SQL_POS_DELETE, SQL_POS_OPERATIONS, SQL_POS_POSITION, SQL_POS_UPDATE, SQL_POSITIONED_STATEMENTS, SQL_PROCEDURE_TERM, SQL_PROCEDURES, SQL_PS_POSITIONED_DELETE, SQL_PS_POSITIONED_UPDATE, SQL_QUOTED_IDENTIFIER_CASE, SQL_ROW_UPDATES, SQL_SC_SQL92_ENTRY, SQL_SCC_ISO92_CLI, SQL_SCCO_LOCK, SQL_SCCO_OPT_ROWVER, SQL_SCCO_OPT_VALUES, SQL_SCCO_READ_ONLY, SQL_SCHEMA_TERM, SQL_SCHEMA_USAGE, SQL_SCROLL_CONCURRENCY, SQL_SCROLL_OPTIONS, SQL_SEARCH_PATTERN_ESCAPE, SQL_SENSITIVE, SQL_SERVER_NAME, SQL_SG_WITH_GRANT_OPTION, SQL_SO_DYNAMIC, SQL_SO_FORWARD_ONLY, SQL_SO_KEYSET_DRIVEN, SQL_SO_STATIC, SQL_SP_EXISTS, SQL_SP_ISNOTNULL, SQL_SP_ISNULL, SQL_SPECIAL_CHARACTERS, SQL_SQ_COMPARISON, SQL_SQ_CORRELATED_SUBQUERIES, SQL_SQ_EXISTS, SQL_SQ_IN, SQL_SQ_QUANTIFIED, SQL_SQL92_DATETIME_FUNCTIONS, SQL_SQL92_FOREIGN_KEY_DELETE_RULE, SQL_SQL92_FOREIGN_KEY_UPDATE_RULE, SQL_SQL92_GRANT, SQL_SQL92_NUMERIC_VALUE_FUNCTIONS, SQL_SQL92_PREDICATES, SQL_SQL92_RELATIONAL_JOIN_OPERATORS, SQL_SQL92_REVOKE, SQL_SQL92_ROW_VALUE_CONSTRUCTOR, SQL_SQL92_STRING_FUNCTIONS, SQL_SQL92_VALUE_EXPRESSIONS, SQL_SQL_CONFORMANCE, SQL_SR_GRANT_OPTION_FOR, SQL_SRJO_CROSS_JOIN, SQL_SRJO_FULL_OUTER_JOIN, SQL_SRJO_INNER_JOIN, SQL_SRJO_LEFT_OUTER_JOIN, SQL_SRJO_RIGHT_OUTER_JOIN, SQL_SRJO_UNION_JOIN, SQL_SRVC_DEFAULT, SQL_SRVC_NULL, SQL_SRVC_ROW_SUBQUERY, SQL_SRVC_VALUE_EXPRESSION, SQL_SSF_LOWER, SQL_SSF_UPPER, SQL_STANDARD_CLI_CONFORMANCE, SQL_STATIC_CURSOR_ATTRIBUTES1, SQL_STATIC_CURSOR_ATTRIBUTES2, SQL_STATIC_SENSITIVITY, SQL_STRING_FUNCTIONS, SQL_SUBQUERIES, SQL_SUCCESS, SQL_SVE_CASE, SQL_SVE_CAST, SQL_SVE_COALESCE, SQL_SVE_NULLIF, SQL_SYSTEM_FUNCTIONS, SQL_TABLE_TERM, SQL_TC_ALL, SQL_TIMEDATE_ADD_INTERVALS, SQL_TIMEDATE_DIFF_INTERVALS, SQL_TIMEDATE_FUNCTIONS, SQL_TXN_CAPABLE, SQL_TXN_ISOLATION_OPTION, SQL_TXN_READ_COMMITTED, SQL_TXN_READ_UNCOMMITTED, SQL_TXN_REPEATABLE_READ, SQL_TXN_SERIALIZABLE, SQL_U_UNION, SQL_U_UNION_ALL, SQL_UNION, SQL_USER_NAME, SQL_XOPEN_CLI_YEAR, SQLULEN, tds, TDS_DBG_FUNC, tds_dstr_cstr(), TDS_IS_MSSQL, TDS_MAJOR, TDS_MINOR, TDS_VERSION_MAJOR, TDS_VERSION_MINOR, TDS_VERSION_SUBVERSION, tdsdump_log, UIVAL, ULVAL, USIVAL, and VERSION.

Referenced by SQLGetInfo(), and SQLSetScrollOptions().

◆ _SQLGetStmtAttr()

static SQLRETURN _SQLGetStmtAttr ( SQLHSTMT  hstmt,
SQLINTEGER  Attribute,
SQLPOINTER  Value,
SQLINTEGER  BufferLength,
SQLINTEGER StringLength 
)
static

◆ _SQLNativeSql()

static SQLRETURN _SQLNativeSql ( SQLHDBC  hdbc,
SQLCHAR szSqlStrIn,
SQLINTEGER  cbSqlStrIn,
SQLCHAR szSqlStr,
SQLINTEGER  cbSqlStrMax,
SQLINTEGER FAR pcbSqlStr 
)
static

◆ _SQLParamData()

static SQLRETURN _SQLParamData ( SQLHSTMT  hstmt,
SQLPOINTER FAR prgbValue 
)
static

◆ _SQLPrepare()

static SQLRETURN _SQLPrepare ( SQLHSTMT  hstmt,
SQLCHAR szSqlStr,
SQLINTEGER  cbSqlStr 
)
static

◆ _SQLPrimaryKeys()

static SQLRETURN _SQLPrimaryKeys ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName 
)
static

◆ _SQLProcedureColumns()

static SQLRETURN _SQLProcedureColumns ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szProcName,
SQLSMALLINT  cbProcName,
SQLCHAR szColumnName,
SQLSMALLINT  cbColumnName 
)
static

◆ _SQLProcedures()

static SQLRETURN _SQLProcedures ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szProcName,
SQLSMALLINT  cbProcName 
)
static

◆ _SQLRowCount()

SQLRETURN _SQLRowCount ( SQLHSTMT  hstmt,
SQLLEN FAR pcrow 
)

Definition at line 4598 of file odbc.c.

References ODBC_ENTER_HSTMT, ODBC_EXIT_, stmt, TDS_DBG_FUNC, and tdsdump_log.

Referenced by SQLRowCount().

◆ _SQLSetConnectAttr()

static SQLRETURN _SQLSetConnectAttr ( SQLHDBC  hdbc,
SQLINTEGER  Attribute,
SQLPOINTER  ValuePtr,
SQLINTEGER  StringLength 
)
static

◆ _SQLSetCursorName()

static SQLRETURN _SQLSetCursorName ( SQLHSTMT  hstmt,
SQLCHAR szCursor,
SQLSMALLINT  cbCursor 
)
static

Definition at line 4617 of file odbc.c.

References NULL, odbc_dstr_copy(), ODBC_ENTER_HSTMT, odbc_errs_add(), ODBC_EXIT_, and stmt.

Referenced by SQLSetCursorName().

◆ _SQLSetDescField()

static SQLRETURN _SQLSetDescField ( SQLHDESC  hdesc,
SQLSMALLINT  icol,
SQLSMALLINT  fDescType,
SQLPOINTER  Value,
SQLINTEGER  BufferLength 
)
static

Definition at line 2731 of file odbc.c.

References desc_alloc_records(), desc_get_dbc(), DESC_IPD, DESC_IRD, DESC_SET_NEED_REPREPARE, IIN, int, n, NULL, ODBC_CHAR, odbc_dstr_copy_oct, ODBC_ENTER_HDESC, odbc_errs_add(), ODBC_EXIT, ODBC_EXIT_, odbc_set_concise_c_type(), odbc_set_concise_sql_type(), PIN, result, SQL_DECIMAL, SQL_DESC_ALLOC_TYPE, SQL_DESC_ARRAY_SIZE, SQL_DESC_ARRAY_STATUS_PTR, SQL_DESC_AUTO_UNIQUE_VALUE, SQL_DESC_BASE_COLUMN_NAME, SQL_DESC_BASE_TABLE_NAME, SQL_DESC_BIND_TYPE, SQL_DESC_CASE_SENSITIVE, SQL_DESC_CATALOG_NAME, _drecord::sql_desc_concise_type, SQL_DESC_CONCISE_TYPE, SQL_DESC_COUNT, _drecord::sql_desc_data_ptr, SQL_DESC_DATA_PTR, SQL_DESC_DISPLAY_SIZE, SQL_DESC_FIXED_PREC_SCALE, _drecord::sql_desc_indicator_ptr, SQL_DESC_INDICATOR_PTR, SQL_DESC_LABEL, _drecord::sql_desc_length, SQL_DESC_LENGTH, SQL_DESC_LITERAL_PREFIX, SQL_DESC_LITERAL_SUFFIX, SQL_DESC_LOCAL_TYPE_NAME, _drecord::sql_desc_name, SQL_DESC_NAME, SQL_DESC_NULLABLE, _drecord::sql_desc_num_prec_radix, SQL_DESC_NUM_PREC_RADIX, _drecord::sql_desc_octet_length, SQL_DESC_OCTET_LENGTH, _drecord::sql_desc_octet_length_ptr, SQL_DESC_OCTET_LENGTH_PTR, _drecord::sql_desc_parameter_type, SQL_DESC_PARAMETER_TYPE, _drecord::sql_desc_precision, SQL_DESC_PRECISION, SQL_DESC_ROWS_PROCESSED_PTR, SQL_DESC_ROWVER, _drecord::sql_desc_scale, SQL_DESC_SCALE, SQL_DESC_SCHEMA_NAME, SQL_DESC_SEARCHABLE, SQL_DESC_TABLE_NAME, _drecord::sql_desc_type, SQL_DESC_TYPE, SQL_DESC_TYPE_NAME, _drecord::sql_desc_unnamed, SQL_DESC_UNNAMED, SQL_DESC_UNSIGNED, SQL_DESC_UPDATABLE, SQL_ERROR, SQL_NUMERIC, SQL_SUCCESS, SQLLEN, SQLULEN, TDS_DBG_INFO1, and tdsdump_log.

Referenced by SQLSetDescField().

◆ _SQLSetStmtAttr()

static SQLRETURN _SQLSetStmtAttr ( SQLHSTMT  hstmt,
SQLINTEGER  Attribute,
SQLPOINTER  ValuePtr,
SQLINTEGER  StringLength 
)
static

Definition at line 6393 of file odbc.c.

References IS_VALID_LEN, NULL, ODBC_CHAR, odbc_dstr_copy_oct, ODBC_ENTER_HSTMT, odbc_errs_add(), ODBC_EXIT_, orig, SQL_ATTR_APP_PARAM_DESC, SQL_ATTR_APP_ROW_DESC, SQL_ATTR_ASYNC_ENABLE, SQL_ATTR_CONCURRENCY, SQL_ATTR_CURSOR_SCROLLABLE, SQL_ATTR_CURSOR_SENSITIVITY, SQL_ATTR_CURSOR_TYPE, SQL_ATTR_ENABLE_AUTO_IPD, SQL_ATTR_FETCH_BOOKMARK_PTR, SQL_ATTR_IMP_PARAM_DESC, SQL_ATTR_IMP_ROW_DESC, SQL_ATTR_KEYSET_SIZE, SQL_ATTR_MAX_LENGTH, SQL_ATTR_MAX_ROWS, SQL_ATTR_METADATA_ID, SQL_ATTR_NOSCAN, SQL_ATTR_PARAM_BIND_OFFSET_PTR, SQL_ATTR_PARAM_BIND_TYPE, SQL_ATTR_PARAM_OPERATION_PTR, SQL_ATTR_PARAM_STATUS_PTR, SQL_ATTR_PARAMS_PROCESSED_PTR, SQL_ATTR_PARAMSET_SIZE, SQL_ATTR_QUERY_TIMEOUT, SQL_ATTR_RETRIEVE_DATA, SQL_ATTR_ROW_ARRAY_SIZE, SQL_ATTR_ROW_BIND_OFFSET_PTR, SQL_ATTR_ROW_BIND_TYPE, SQL_ATTR_ROW_NUMBER, SQL_ATTR_ROW_OPERATION_PTR, SQL_ATTR_ROW_STATUS_PTR, SQL_ATTR_ROWS_FETCHED_PTR, SQL_ATTR_SIMULATE_CURSOR, SQL_ATTR_USE_BOOKMARKS, SQL_BIND_TYPE, SQL_CONCUR_LOCK, SQL_CONCUR_READ_ONLY, SQL_CONCUR_ROWVER, SQL_CONCUR_VALUES, SQL_CURSOR_DYNAMIC, SQL_CURSOR_FORWARD_ONLY, SQL_CURSOR_KEYSET_DRIVEN, SQL_CURSOR_STATIC, SQL_DESC_ALLOC_USER, SQL_INSENSITIVE, SQL_NONSCROLLABLE, SQL_ROWSET_SIZE, SQL_SCROLLABLE, SQL_SENSITIVE, SQL_SOPT_SS_QUERYNOTIFICATION_MSGTEXT, SQL_SOPT_SS_QUERYNOTIFICATION_OPTIONS, SQL_SOPT_SS_QUERYNOTIFICATION_TIMEOUT, SQL_UNSPECIFIED, SQLLEN, SQLULEN, stmt, TDS_DBG_FUNC, tdsdump_log, and val.

Referenced by _SQLAllocStmt(), SQLParamOptions(), SQLSetScrollOptions(), and SQLSetStmtOption().

◆ _SQLSpecialColumns()

static SQLRETURN _SQLSpecialColumns ( SQLHSTMT  hstmt,
SQLUSMALLINT  fColType,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName,
SQLUSMALLINT  fScope,
SQLUSMALLINT  fNullable 
)
static

◆ _SQLStatistics()

static SQLRETURN _SQLStatistics ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName,
SQLUSMALLINT  fUnique,
SQLUSMALLINT  fAccuracy 
)
static

◆ _SQLTablePrivileges()

static SQLRETURN _SQLTablePrivileges ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName 
)
static

◆ _SQLTables()

static SQLRETURN _SQLTables ( SQLHSTMT  hstmt,
SQLCHAR szCatalogName,
SQLSMALLINT  cbCatalogName,
SQLCHAR szSchemaName,
SQLSMALLINT  cbSchemaName,
SQLCHAR szTableName,
SQLSMALLINT  cbTableName,
SQLCHAR szTableType,
SQLSMALLINT  cbTableType 
)
static

◆ _SQLTransact()

static SQLRETURN _SQLTransact ( SQLHENV  henv,
SQLHDBC  hdbc,
SQLUSMALLINT  fType 
)
static

Definition at line 4694 of file odbc.c.

References change_transaction(), dbc, ODBC_ENTER_HDBC, ODBC_EXIT, SQL_COMMIT, TDS_DBG_FUNC, and tdsdump_log.

Referenced by SQLTransact().

◆ change_autocommit()

static SQLRETURN change_autocommit ( TDS_DBC dbc,
int  state 
)
static

◆ change_database()

static SQLRETURN change_database ( TDS_DBC dbc,
const char *  database,
size_t  database_len 
)
static

◆ change_transaction()

static SQLRETURN change_transaction ( TDS_DBC dbc,
int  state 
)
static

◆ change_txn()

static SQLRETURN change_txn ( TDS_DBC dbc,
SQLUINTEGER  txn_isolation 
)
static

◆ odbc_add_char_param()

static TDSPARAMINFO* odbc_add_char_param ( TDSSOCKET tds,
TDSPARAMINFO params,
const char *  name,
const char *  value,
TDS_INT  len 
)
static

◆ odbc_add_int_param()

static TDSPARAMINFO* odbc_add_int_param ( TDSSOCKET tds,
TDSPARAMINFO params,
const char *  name,
int  value 
)
static

◆ odbc_build_update_params()

static TDSPARAMINFO* odbc_build_update_params ( TDS_STMT stmt,
SQLSETPOSIROW  n_row 
)
static

◆ odbc_col_setname()

static void odbc_col_setname ( TDS_STMT stmt,
int  colpos,
const char *  name 
)
static

◆ odbc_connect()

static SQLRETURN odbc_connect ( TDS_DBC dbc,
TDSLOGIN login 
)
static

◆ odbc_cursor_execute()

static TDSRET odbc_cursor_execute ( TDS_STMT stmt)
static

◆ odbc_env_change()

static void odbc_env_change ( TDSSOCKET tds,
int  type,
char *  oldval,
char *  newval 
)
static

Definition at line 335 of file odbc.c.

References assert, dbc, odbc_get_dbc(), tds, tds_dstr_copy(), TDS_ENV_DATABASE, and TDS_ENV_PACKSIZE.

Referenced by odbc_connect().

◆ odbc_errmsg_handler()

static int odbc_errmsg_handler ( const TDSCONTEXT ctx,
TDSSOCKET tds,
TDSMESSAGE msg 
)
static

◆ odbc_fix_data_type_col()

static void odbc_fix_data_type_col ( TDS_STMT stmt,
int  idx 
)
static

◆ odbc_free_cursor()

static SQLRETURN odbc_free_cursor ( TDS_STMT stmt)
static

◆ odbc_free_dynamic()

static SQLRETURN odbc_free_dynamic ( TDS_STMT stmt)
static

◆ odbc_get_dbc()

static TDS_DBC* odbc_get_dbc ( TDSSOCKET tds)
static

Definition at line 313 of file odbc.c.

References assert, chk(), NULL, SQL_HANDLE_DBC, SQL_HANDLE_STMT, tds, and tds_get_parent.

Referenced by odbc_env_change(), and odbc_errmsg_handler().

◆ odbc_get_stmt()

static TDS_STMT* odbc_get_stmt ( TDSSOCKET tds)
static

Definition at line 325 of file odbc.c.

References chk(), NULL, SQL_HANDLE_STMT, tds, and tds_get_parent.

Referenced by odbc_errmsg_handler().

◆ odbc_init_headers()

static TDSHEADERS* odbc_init_headers ( TDS_STMT stmt,
TDSHEADERS head 
)
static

Definition at line 3237 of file odbc.c.

References head, NULL, stmt, tds_dstr_cstr(), and tds_dstr_isempty().

Referenced by _SQLExecute().

◆ odbc_lock_statement()

static int odbc_lock_statement ( TDS_STMT stmt)
static

◆ odbc_log_unimplemented_type()

static void odbc_log_unimplemented_type ( const char  function_name[],
int  fType 
)
static

Log a useful message about unimplemented options Defying belief, Microsoft defines mutually exclusive options that some ODBC implementations #define as duplicate values (meaning, of course, that they couldn't be implemented in the same function because they're indistinguishable.

Those duplicates are commented out below.

Definition at line 7026 of file odbc.c.

References SQL_COLLATION_SEQ, SQL_CONVERT_BIGINT, SQL_CONVERT_DATE, SQL_CONVERT_DOUBLE, SQL_CONVERT_INTERVAL_DAY_TIME, SQL_CONVERT_INTERVAL_YEAR_MONTH, SQL_DM_VER, SQL_DRIVER_HDESC, SQL_DRIVER_HLIB, SQL_USER_NAME, TDS_DBG_INFO1, and tdsdump_log.

Referenced by _SQLGetInfo().

◆ odbc_populate_ird()

static SQLRETURN odbc_populate_ird ( TDS_STMT stmt)
static

◆ odbc_prepare()

static SQLRETURN odbc_prepare ( TDS_STMT stmt)
static

◆ odbc_process_tokens()

static int odbc_process_tokens ( TDS_STMT stmt,
unsigned  flag 
)
static

◆ odbc_prret()

static const char* odbc_prret ( SQLRETURN  ret,
char *  unknown,
size_t  unknown_size 
)
static

◆ odbc_quote_metadata()

static size_t odbc_quote_metadata ( TDS_DBC dbc,
char  type,
char *  dest,
DSTR dstr 
)
static

Definition at line 7103 of file odbc.c.

References assert, buf, dbc, len, prev(), SQL_FALSE, tds_dstr_cstr(), and tds_dstr_len().

Referenced by odbc_stat_execute().

◆ odbc_stat_execute()

static SQLRETURN odbc_stat_execute ( TDS_STMT *stmt  _WIDE,
const char *  begin,
int  nparams,
  ... 
)
static

◆ odbc_swap_datetime_sql_type()

static SQLSMALLINT odbc_swap_datetime_sql_type ( SQLSMALLINT  sql_type,
int  version 
)
static

Change sql datatype to a specific version.

Parameters
sql_typesql data type to change (any type)
versionODBC version to change to, 2 for ODBC 2, 3 for ODBC 3, 0 swap

Definition at line 5981 of file odbc.c.

References SQL_DATE, SQL_TIME, SQL_TIMESTAMP, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, and version.

Referenced by odbc_fix_data_type_col(), and SQLGetTypeInfo().

◆ odbc_unlock_statement()

static void odbc_unlock_statement ( TDS_STMT stmt)
static

◆ odbc_unquote()

static void odbc_unquote ( char *  buf,
size_t  buf_len,
const char *  start,
const char *  end 
)
static

Definition at line 2994 of file odbc.c.

References assert, and buf.

Referenced by odbc_populate_ird().

◆ odbc_update_ird()

static SQLRETURN odbc_update_ird ( TDS_STMT stmt,
TDS_ERRS errs 
)
static

◆ odbc_upper_column_names()

static void odbc_upper_column_names ( TDS_STMT stmt)
static

◆ SQLAllocConnect()

SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocConnect ( SQLHENV  henv,
SQLHDBC FAR phdbc 
)

Definition at line 1601 of file odbc.c.

References _SQLAllocConnect(), TDS_DBG_FUNC, and tdsdump_log.

◆ SQLAllocEnv()

SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocEnv ( SQLHENV FAR phenv)

Definition at line 1646 of file odbc.c.

References _SQLAllocEnv(), SQL_OV_ODBC2, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLAllocStmt()

SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocStmt ( SQLHDBC  hdbc,
SQLHSTMT FAR phstmt 
)

Definition at line 1794 of file odbc.c.

References _SQLAllocStmt(), TDS_DBG_FUNC, and tdsdump_log.

◆ SQLBindCol()

SQLRETURN ODBC_PUBLIC ODBC_API SQLBindCol ( SQLHSTMT  hstmt,
SQLUSMALLINT  icol,
SQLSMALLINT  fCType,
SQLPOINTER  rgbValue,
SQLLEN  cbValueMax,
SQLLEN FAR pcbValue 
)

◆ SQLBindParam()

SQLRETURN ODBC_PUBLIC ODBC_API SQLBindParam ( SQLHSTMT  hstmt,
SQLUSMALLINT  ipar,
SQLSMALLINT  fCType,
SQLSMALLINT  fSqlType,
SQLULEN  cbColDef,
SQLSMALLINT  ibScale,
SQLPOINTER  rgbValue,
SQLLEN FAR pcbValue 
)

Definition at line 1502 of file odbc.c.

References _SQLBindParameter(), SQL_PARAM_INPUT, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLBindParameter()

SQLRETURN ODBC_PUBLIC ODBC_API SQLBindParameter ( SQLHSTMT  hstmt,
SQLUSMALLINT  ipar,
SQLSMALLINT  fParamType,
SQLSMALLINT  fCType,
SQLSMALLINT  fSqlType,
SQLULEN  cbColDef,
SQLSMALLINT  ibScale,
SQLPOINTER  rgbValue,
SQLLEN  cbValueMax,
SQLLEN FAR pcbValue 
)

Definition at line 1491 of file odbc.c.

References _SQLBindParameter(), TDS_DBG_FUNC, and tdsdump_log.

◆ SQLCancel()

SQLRETURN ODBC_PUBLIC ODBC_API SQLCancel ( SQLHSTMT  hstmt)

◆ SQLCloseCursor()

SQLRETURN ODBC_PUBLIC ODBC_API SQLCloseCursor ( SQLHSTMT  hstmt)

Definition at line 4245 of file odbc.c.

References _SQLFreeStmt(), SQL_CLOSE, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLColAttributes()

SQLRETURN ODBC_PUBLIC ODBC_API SQLColAttributes ( SQLHSTMT  hstmt,
SQLUSMALLINT  icol,
SQLUSMALLINT  fDescType,
SQLPOINTER  rgbDesc,
SQLSMALLINT  cbDescMax,
SQLSMALLINT FAR pcbDesc,
SQLLEN FAR pfDesc 
)

Definition at line 2268 of file odbc.c.

References _SQLColAttribute(), _wide0, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLCopyDesc()

SQLRETURN ODBC_PUBLIC ODBC_API SQLCopyDesc ( SQLHDESC  hsrc,
SQLHDESC  hdesc 
)

◆ SQLDisconnect()

SQLRETURN ODBC_PUBLIC ODBC_API SQLDisconnect ( SQLHDBC  hdbc)

◆ SQLExecute()

SQLRETURN ODBC_PUBLIC ODBC_API SQLExecute ( SQLHSTMT  hstmt)

◆ SQLExtendedFetch()

SQLRETURN ODBC_PUBLIC ODBC_API SQLExtendedFetch ( SQLHSTMT  hstmt,
SQLUSMALLINT  fFetchType,
SQLROWOFFSET  irow,
SQLROWSETSIZE FAR pcrow,
SQLUSMALLINT FAR rgfRowStatus 
)

◆ SQLFetch()

SQLRETURN ODBC_PUBLIC ODBC_API SQLFetch ( SQLHSTMT  hstmt)

◆ SQLFreeEnv()

SQLRETURN ODBC_PUBLIC ODBC_API SQLFreeEnv ( SQLHENV  henv)

Definition at line 4142 of file odbc.c.

References _SQLFreeEnv(), TDS_DBG_FUNC, and tdsdump_log.

◆ SQLFreeStmt()

SQLRETURN ODBC_PUBLIC ODBC_API SQLFreeStmt ( SQLHSTMT  hstmt,
SQLUSMALLINT  fOption 
)

Definition at line 4237 of file odbc.c.

References _SQLFreeStmt(), TDS_DBG_FUNC, and tdsdump_log.

◆ SQLGetConnectOption()

SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectOption ( SQLHDBC  hdbc,
SQLUSMALLINT  fOption,
SQLPOINTER  pvParam 
)

◆ SQLGetData()

SQLRETURN ODBC_PUBLIC ODBC_API SQLGetData ( SQLHSTMT  hstmt,
SQLUSMALLINT  icol,
SQLSMALLINT  fCType,
SQLPOINTER  rgbValue,
SQLLEN  cbValueMax,
SQLLEN FAR pcbValue 
)

◆ SQLGetFunctions()

SQLRETURN ODBC_PUBLIC ODBC_API SQLGetFunctions ( SQLHDBC  hdbc,
SQLUSMALLINT  fFunction,
SQLUSMALLINT FAR pfExists 
)

◆ SQLGetInfo()

SQLRETURN ODBC_PUBLIC ODBC_API SQLGetInfo ( SQLHDBC  hdbc,
SQLUSMALLINT  fInfoType,
SQLPOINTER  rgbInfoValue,
SQLSMALLINT  cbInfoValueMax,
SQLSMALLINT FAR pcbInfoValue 
)

Definition at line 5901 of file odbc.c.

References _SQLGetInfo(), _wide0, dbc, ODBC_ENTER_HDBC, ODBC_EXIT, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLGetStmtOption()

SQLRETURN ODBC_PUBLIC ODBC_API SQLGetStmtOption ( SQLHSTMT  hstmt,
SQLUSMALLINT  fOption,
SQLPOINTER  pvParam 
)

◆ SQLGetTypeInfo()

SQLRETURN ODBC_PUBLIC ODBC_API SQLGetTypeInfo ( SQLHSTMT  hstmt,
SQLSMALLINT  fSqlType 
)

◆ SQLMoreResults()

SQLRETURN ODBC_PUBLIC ODBC_API SQLMoreResults ( SQLHSTMT  hstmt)

◆ SQLNumParams()

SQLRETURN ODBC_PUBLIC ODBC_API SQLNumParams ( SQLHSTMT  hstmt,
SQLSMALLINT FAR pcpar 
)

Definition at line 1073 of file odbc.c.

References ODBC_ENTER_HSTMT, ODBC_EXIT_, stmt, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLNumResultCols()

SQLRETURN ODBC_PUBLIC ODBC_API SQLNumResultCols ( SQLHSTMT  hstmt,
SQLSMALLINT FAR pccol 
)

◆ SQLParamData()

SQLRETURN ODBC_PUBLIC ODBC_API SQLParamData ( SQLHSTMT  hstmt,
SQLPOINTER FAR prgbValue 
)

Definition at line 6175 of file odbc.c.

References _SQLParamData(), odbc_prret, ODBC_PRRET_BUF, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLParamOptions()

SQLRETURN ODBC_PUBLIC ODBC_API SQLParamOptions ( SQLHSTMT  hstmt,
SQLULEN  crow,
SQLULEN FAR pirow 
)

◆ SQLPutData()

SQLRETURN ODBC_PUBLIC ODBC_API SQLPutData ( SQLHSTMT  hstmt,
SQLPOINTER  rgbValue,
SQLLEN  cbValue 
)

◆ SQLRowCount()

SQLRETURN ODBC_PUBLIC ODBC_API SQLRowCount ( SQLHSTMT  hstmt,
SQLLEN FAR pcrow 
)

Definition at line 4610 of file odbc.c.

References _SQLRowCount(), TDS_DBG_INFO1, and tdsdump_log.

◆ SQLSetConnectOption()

SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectOption ( SQLHDBC  hdbc,
SQLUSMALLINT  fOption,
SQLULEN  vParam 
)

Definition at line 6375 of file odbc.c.

References _SQLSetConnectAttr(), _wide0, SQL_NTS, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLSetDescRec()

SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescRec ( SQLHDESC  hdesc,
SQLSMALLINT  nRecordNumber,
SQLSMALLINT  nType,
SQLSMALLINT  nSubType,
SQLLEN  nLength,
SQLSMALLINT  nPrecision,
SQLSMALLINT  nScale,
SQLPOINTER  pData,
SQLLEN FAR pnStringLength,
SQLLEN FAR pnIndicator 
)

◆ SQLSetParam()

SQLRETURN ODBC_PUBLIC ODBC_API SQLSetParam ( SQLHSTMT  hstmt,
SQLUSMALLINT  ipar,
SQLSMALLINT  fCType,
SQLSMALLINT  fSqlType,
SQLULEN  cbParamDef,
SQLSMALLINT  ibScale,
SQLPOINTER  rgbValue,
SQLLEN FAR pcbValue 
)

◆ SQLSetPos()

SQLRETURN ODBC_PUBLIC ODBC_API SQLSetPos ( SQLHSTMT  hstmt,
SQLSETPOSIROW  irow,
SQLUSMALLINT  fOption,
SQLUSMALLINT  fLock 
)

◆ SQLSetScrollOptions()

SQLRETURN ODBC_PUBLIC ODBC_API SQLSetScrollOptions ( SQLHSTMT  hstmt,
SQLUSMALLINT  fConcurrency,
SQLLEN  crowKeyset,
SQLUSMALLINT  crowRowset 
)

◆ SQLSetStmtOption()

SQLRETURN ODBC_PUBLIC ODBC_API SQLSetStmtOption ( SQLHSTMT  hstmt,
SQLUSMALLINT  fOption,
SQLULEN  vParam 
)

Definition at line 6722 of file odbc.c.

References _SQLSetStmtAttr(), _wide0, SQL_NTS, TDS_DBG_FUNC, and tdsdump_log.

◆ SQLTransact()

SQLRETURN ODBC_PUBLIC ODBC_API SQLTransact ( SQLHENV  henv,
SQLHDBC  hdbc,
SQLUSMALLINT  fType 
)

Definition at line 4710 of file odbc.c.

References _SQLTransact(), TDS_DBG_FUNC, and tdsdump_log.

◆ tds_ascii_strupr()

static void tds_ascii_strupr ( char *  s)
static

Definition at line 5927 of file odbc.c.

Referenced by odbc_upper_column_names().

Modified on Fri Jun 14 16:55:07 2024 by modify_doxy.py rev. 669887