NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions
odbc.h File Reference
#include <freetds/tds.h>
#include <freetds/thread.h>
#include <freetds/data.h>
#include <isql.h>
#include <isqlext.h>
#include <wchar.h>
#include <freetds/pushvis.h>
#include <freetds/popvis.h>
+ Include dependency graph for odbc.h:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  _sql_error
 
struct  _sql_errors
 
struct  _dheader
 Descriptor header. More...
 
struct  _drecord
 Descriptor record. More...
 
struct  _hdesc
 
struct  _heattr
 
struct  _hchk
 
struct  _henv
 
struct  _hcattr
 
struct  _hdbc
 
struct  _hsattr
 
struct  _hstmt
 
struct  TDS_FUNCS
 
struct  TDS_PARSED_PARAM
 

Macros

#define TDS_DONT_DEFINE_DEFAULT_FUNCTIONS
 
#define SQLULEN   SQLUINTEGER
 
#define SQLLEN   SQLINTEGER
 
#define SQLSETPOSIROW   SQLUSMALLINT
 
#define SQLROWOFFSET   SQLLEN
 
#define SQLROWSETSIZE   SQLULEN
 
#define ODBC_API   SQL_API
 
#define ODBC_PUBLIC
 
#define ODBC_MAX(a, b)   ( (a) > (b) ? (a) : (b) )
 
#define ODBC_MIN(a, b)   ( (a) < (b) ? (a) : (b) )
 
#define ODBC_RETURN(handle, rc)
 
#define ODBC_RETURN_(handle)
 
#define ODBC_EXIT(handle, rc)
 
#define ODBC_EXIT_(handle)
 
#define DESC_IRD   1
 
#define DESC_IPD   2
 
#define DESC_ARD   3
 
#define DESC_APD   4
 
#define TDS_MAX_APP_DESC   100
 
#define IS_HENV(x)   (((TDS_CHK *)x)->htype == SQL_HANDLE_ENV)
 
#define IS_HDBC(x)   (((TDS_CHK *)x)->htype == SQL_HANDLE_DBC)
 
#define IS_HSTMT(x)   (((TDS_CHK *)x)->htype == SQL_HANDLE_STMT)
 
#define IS_HDESC(x)   (((TDS_CHK *)x)->htype == SQL_HANDLE_DESC)
 
#define ODBC_PARAM_LIST
 
#define ODBC_PARAM(p)   ODBC_PARAM_##p,
 
#define CHECK_ENV_EXTRA(env)
 
#define CHECK_DBC_EXTRA(dbc)
 
#define CHECK_STMT_EXTRA(stmt)
 
#define CHECK_DESC_EXTRA(desc)
 
#define _wide
 
#define _wide0
 
#define _WIDE
 
#define ODBC_CHAR   SQLCHAR
 
#define odbc_dstr_copy_oct   odbc_dstr_copy
 
#define odbc_set_string(dbc, buf, buf_len, out_len, s, s_len)    odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0:0x10))
 
#define odbc_set_string_oct(dbc, buf, buf_len, out_len, s, s_len)    odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0x20:0x30))
 
#define sqlwcslen(s)   wcslen(s)
 
#define SQLWSTR_BUFS(n)   do {} while(0)
 
#define SQLWSTR(s)   ((const wchar_t*)(s))
 
#define SQLWSTR_FREE()   do {} while(0)
 

Typedefs

typedef struct _sql_errors TDS_ERRS
 
typedef struct _hdesc TDS_DESC
 
typedef struct _henv TDS_ENV
 
typedef struct _hdbc TDS_DBC
 
typedef struct _hstmt TDS_STMT
 
typedef struct _hchk TDS_CHK
 

Enumerations

enum  TDS_ODBC_ROW_STATUS {
  NOT_IN_ROW , IN_NORMAL_ROW , IN_COMPUTE_ROW , AFTER_COMPUTE_ROW ,
  PRE_NORMAL_ROW , NOT_IN_ROW , IN_NORMAL_ROW , IN_COMPUTE_ROW ,
  AFTER_COMPUTE_ROW , PRE_NORMAL_ROW
}
 
enum  TDS_ODBC_SPECIAL_ROWS {
  ODBC_SPECIAL_NONE = 0 , ODBC_SPECIAL_GETTYPEINFO = 1 , ODBC_SPECIAL_COLUMNS = 2 , ODBC_SPECIAL_PROCEDURECOLUMNS = 3 ,
  ODBC_SPECIAL_SPECIALCOLUMNS = 4 , ODBC_SPECIAL_NONE = 0 , ODBC_SPECIAL_GETTYPEINFO = 1 , ODBC_SPECIAL_COLUMNS = 2 ,
  ODBC_SPECIAL_PROCEDURECOLUMNS = 3 , ODBC_SPECIAL_SPECIALCOLUMNS = 4
}
 
enum  {
  ODBC_PARAM_Servername , ODBC_PARAM_Server , ODBC_PARAM_DSN , ODBC_PARAM_UID ,
  ODBC_PARAM_PWD , ODBC_PARAM_Address , ODBC_PARAM_Port , ODBC_PARAM_TDS_Version ,
  ODBC_PARAM_Language , ODBC_PARAM_Database , ODBC_PARAM_TextSize , ODBC_PARAM_PacketSize ,
  ODBC_PARAM_ClientCharset , ODBC_PARAM_DumpFile , ODBC_PARAM_DumpFileAppend , ODBC_PARAM_DebugFlags ,
  ODBC_PARAM_Encryption , ODBC_PARAM_Trusted_Connection , ODBC_PARAM_APP , ODBC_PARAM_WSID ,
  ODBC_PARAM_UseNTLMv2 , ODBC_PARAM_MARS_Connection , ODBC_PARAM_REALM , ODBC_PARAM_ServerSPN ,
  ODBC_PARAM_AttachDbFilename , ODBC_PARAM_ApplicationIntent , ODBC_PARAM_SIZE
}
 

Functions

static void odbc_check_struct_extra (void *p)
 
void odbc_errs_reset (struct _sql_errors *errs)
 reset errors More...
 
void odbc_errs_add (struct _sql_errors *errs, const char *sqlstate, const char *msg)
 add an error to list More...
 
void odbc_errs_add_rdbms (struct _sql_errors *errs, TDS_UINT native, const char *sqlstate, const char *msg, int linenum, int msgstate, const char *server, int row)
 Add an error to list. More...
 
int odbc_parse_connect_string (TDS_ERRS *errs, const char *connect_string, const char *connect_string_end, TDSLOGIN *login, TDS_PARSED_PARAM *parsed_params)
 Parses a connection string for SQLDriverConnect(). More...
 
int odbc_get_dsn_info (TDS_ERRS *errs, const char *DSN, TDSLOGIN *login)
 Read connection information from given DSN. More...
 
SQLINTEGER odbc_tds2sql (TDS_STMT *stmt, TDSCOLUMN *curcol, int srctype, TDS_CHAR *src, TDS_UINT srclen, int desttype, TDS_CHAR *dest, SQLUINTEGER destlen, const struct _drecord *drec_ixd)
 
TDS_DESCdesc_alloc (SQLHANDLE parent, int desc_type, int alloc_type)
 
SQLRETURN desc_free (TDS_DESC *desc)
 
SQLRETURN desc_alloc_records (TDS_DESC *desc, unsigned count)
 
SQLRETURN desc_copy (TDS_DESC *dest, TDS_DESC *src)
 
SQLRETURN desc_free_records (TDS_DESC *desc)
 
TDS_DBCdesc_get_dbc (TDS_DESC *desc)
 
SQLRETURN _SQLRowCount (SQLHSTMT hstmt, SQLINTEGER FAR *pcrow)
 
int odbc_set_stmt_query (struct _hstmt *stmt, const SQLCHAR *sql, ssize_t sql_len)
 
void odbc_set_return_status (struct _hstmt *stmt, unsigned int n_row)
 
void odbc_set_return_params (struct _hstmt *stmt, unsigned int n_row)
 
void odbc_set_sql_type_info (TDSCOLUMN *col, struct _drecord *drec, SQLINTEGER odbc_ver)
 
int odbc_sql_to_c_type_default (int sql_type)
 
TDS_SERVER_TYPE odbc_sql_to_server_type (TDSCONNECTION *conn, int sql_type, int sql_unsigned)
 
TDS_SERVER_TYPE odbc_c_to_server_type (int c_type)
 Pass this an SQL_C_* type and get a SYB* type which most closely corresponds to the SQL_C_* type. More...
 
size_t odbc_get_string_size (ssize_t size, const SQLCHAR *str)
 
void odbc_rdbms_version (TDSSOCKET *tds_socket, char *pversion_string)
 Returns the version of the RDBMS in the ODBC format. More...
 
SQLINTEGER odbc_get_param_len (const struct _drecord *drec_axd, const struct _drecord *drec_ixd, const TDS_DESC *axd, SQLUSMALLINT n_row)
 
DSTRodbc_dstr_copy (TDS_DBC *dbc, DSTR *s, int size, const SQLCHAR *str)
 
SQLRETURN odbc_set_string_flag (TDS_DBC *dbc, SQLPOINTER buffer, SQLINTEGER cbBuffer, void FAR *pcbBuffer, const char *s, ssize_t len, int flag)
 Copy a string to client setting size according to ODBC convenction. More...
 
SQLSMALLINT odbc_get_concise_sql_type (SQLSMALLINT type, SQLSMALLINT interval)
 
SQLRETURN odbc_set_concise_sql_type (SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
 Set concise type and all cascading field. More...
 
SQLSMALLINT odbc_get_concise_c_type (SQLSMALLINT type, SQLSMALLINT interval)
 
SQLRETURN odbc_set_concise_c_type (SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
 Set concise type and all cascading field. More...
 
SQLINTEGER odbc_get_octet_len (int c_type, const struct _drecord *drec)
 
void odbc_convert_err_set (struct _sql_errors *errs, TDS_INT err)
 
SQLRETURN prepare_call (struct _hstmt *stmt)
 
SQLRETURN native_sql (struct _hdbc *dbc, DSTR *s)
 
int parse_prepared_query (struct _hstmt *stmt, int compute_row)
 
int start_parse_prepared_query (struct _hstmt *stmt, int compute_row)
 
int continue_parse_prepared_query (struct _hstmt *stmt, SQLPOINTER DataPtr, SQLINTEGER StrLen_or_Ind)
 
const char * parse_const_param (const char *s, TDS_SERVER_TYPE *type)
 
const char * odbc_skip_rpc_name (const char *s)
 
SQLRETURN odbc_sql2tds (TDS_STMT *stmt, const struct _drecord *drec_ixd, const struct _drecord *drec_axd, TDSCOLUMN *curcol, int compute_row, const TDS_DESC *axd, SQLUSMALLINT n_row)
 
TDS_INT convert_datetime2server (int bindtype, const void *src, TDS_DATETIMEALL *dta)
 
void odbc_bcp_free_storage (TDS_DBC *dbc)
 
void odbc_bcp_init (TDS_DBC *dbc, const SQLCHAR *tblname, const SQLCHAR *hfile, const SQLCHAR *errfile, int direction)
 
void odbc_bcp_control (TDS_DBC *dbc, int field, void *value)
 Set BCP options for data transfer. More...
 
void odbc_bcp_colptr (TDS_DBC *dbc, const void *colptr, int table_column)
 Override bcp_bind() by pointing to a different host variable. More...
 
void odbc_bcp_sendrow (TDS_DBC *dbc)
 Write data in host variables to the table. More...
 
int odbc_bcp_batch (TDS_DBC *dbc)
 Commit a set of rows to the table. More...
 
int odbc_bcp_done (TDS_DBC *dbc)
 Conclude the transfer of data from program variables. More...
 
void odbc_bcp_bind (TDS_DBC *dbc, const void *varaddr, int prefixlen, int varlen, const void *terminator, int termlen, int vartype, int table_column)
 Bind a program host variable to a database column. More...
 

Macro Definition Documentation

◆ _wide

#define _wide

Definition at line 614 of file odbc.h.

◆ _WIDE

#define _WIDE

Definition at line 616 of file odbc.h.

◆ _wide0

#define _wide0

Definition at line 615 of file odbc.h.

◆ CHECK_DBC_EXTRA

#define CHECK_DBC_EXTRA (   dbc)

Definition at line 593 of file odbc.h.

◆ CHECK_DESC_EXTRA

#define CHECK_DESC_EXTRA (   desc)

Definition at line 595 of file odbc.h.

◆ CHECK_ENV_EXTRA

#define CHECK_ENV_EXTRA (   env)

Definition at line 592 of file odbc.h.

◆ CHECK_STMT_EXTRA

#define CHECK_STMT_EXTRA (   stmt)

Definition at line 594 of file odbc.h.

◆ DESC_APD

#define DESC_APD   4

Definition at line 222 of file odbc.h.

◆ DESC_ARD

#define DESC_ARD   3

Definition at line 221 of file odbc.h.

◆ DESC_IPD

#define DESC_IPD   2

Definition at line 220 of file odbc.h.

◆ DESC_IRD

#define DESC_IRD   1

Definition at line 219 of file odbc.h.

◆ IS_HDBC

#define IS_HDBC (   x)    (((TDS_CHK *)x)->htype == SQL_HANDLE_DBC)

Definition at line 455 of file odbc.h.

◆ IS_HDESC

#define IS_HDESC (   x)    (((TDS_CHK *)x)->htype == SQL_HANDLE_DESC)

Definition at line 457 of file odbc.h.

◆ IS_HENV

#define IS_HENV (   x)    (((TDS_CHK *)x)->htype == SQL_HANDLE_ENV)

Definition at line 454 of file odbc.h.

◆ IS_HSTMT

#define IS_HSTMT (   x)    (((TDS_CHK *)x)->htype == SQL_HANDLE_STMT)

Definition at line 456 of file odbc.h.

◆ ODBC_API

#define ODBC_API   SQL_API

Definition at line 82 of file odbc.h.

◆ ODBC_CHAR

#define ODBC_CHAR   SQLCHAR

Definition at line 617 of file odbc.h.

◆ odbc_dstr_copy_oct

#define odbc_dstr_copy_oct   odbc_dstr_copy

Definition at line 644 of file odbc.h.

◆ ODBC_EXIT

#define ODBC_EXIT (   handle,
  rc 
)
Value:
do { SQLRETURN _odbc_rc = handle->errs.lastrc = (rc); \
odbc_check_struct_extra(handle); \
tds_mutex_unlock(&handle->mtx); \
return _odbc_rc; } while(0)
SQLSMALLINT SQLRETURN
Definition: sqltypes.h:210

Definition at line 129 of file odbc.h.

◆ ODBC_EXIT_

#define ODBC_EXIT_ (   handle)
Value:
do { SQLRETURN _odbc_rc = handle->errs.lastrc; \
odbc_check_struct_extra(handle); \
tds_mutex_unlock(&handle->mtx); \
return _odbc_rc; } while(0)

Definition at line 134 of file odbc.h.

◆ ODBC_MAX

#define ODBC_MAX (   a,
  b 
)    ( (a) > (b) ? (a) : (b) )

Definition at line 91 of file odbc.h.

◆ ODBC_MIN

#define ODBC_MIN (   a,
  b 
)    ( (a) < (b) ? (a) : (b) )

Definition at line 92 of file odbc.h.

◆ ODBC_PARAM

#define ODBC_PARAM (   p)    ODBC_PARAM_##p,

Definition at line 526 of file odbc.h.

◆ ODBC_PARAM_LIST

#define ODBC_PARAM_LIST
Value:
ODBC_PARAM(Servername) \
ODBC_PARAM(Server) \
ODBC_PARAM(DSN) \
ODBC_PARAM(UID) \
ODBC_PARAM(PWD) \
ODBC_PARAM(Address) \
ODBC_PARAM(Port) \
ODBC_PARAM(TDS_Version) \
ODBC_PARAM(Language) \
ODBC_PARAM(Database) \
ODBC_PARAM(TextSize) \
ODBC_PARAM(PacketSize) \
ODBC_PARAM(ClientCharset) \
ODBC_PARAM(DumpFile) \
ODBC_PARAM(DumpFileAppend) \
ODBC_PARAM(DebugFlags) \
ODBC_PARAM(Encryption) \
ODBC_PARAM(Trusted_Connection) \
ODBC_PARAM(APP) \
ODBC_PARAM(WSID) \
ODBC_PARAM(UseNTLMv2) \
ODBC_PARAM(MARS_Connection) \
ODBC_PARAM(REALM) \
ODBC_PARAM(ServerSPN) \
ODBC_PARAM(AttachDbFilename) \
ODBC_PARAM(ApplicationIntent)
static const char * PWD
Definition: common.c:39
#define ODBC_PARAM(p)
Definition: odbc.h:526

Definition at line 498 of file odbc.h.

◆ ODBC_PUBLIC

#define ODBC_PUBLIC

Definition at line 88 of file odbc.h.

◆ ODBC_RETURN

#define ODBC_RETURN (   handle,
  rc 
)
Value:
do { odbc_check_struct_extra(handle); \
return handle->errs.lastrc = (rc); } while(0)
static void odbc_check_struct_extra(void *p)
Definition: odbc.h:119

Definition at line 122 of file odbc.h.

◆ ODBC_RETURN_

#define ODBC_RETURN_ (   handle)
Value:
do { odbc_check_struct_extra(handle); \
return handle->errs.lastrc; } while(0)

Definition at line 125 of file odbc.h.

◆ odbc_set_string

#define odbc_set_string (   dbc,
  buf,
  buf_len,
  out_len,
  s,
  s_len 
)     odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0:0x10))

Definition at line 657 of file odbc.h.

◆ odbc_set_string_oct

#define odbc_set_string_oct (   dbc,
  buf,
  buf_len,
  out_len,
  s,
  s_len 
)     odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0x20:0x30))

Definition at line 659 of file odbc.h.

◆ SQLLEN

#define SQLLEN   SQLINTEGER

Definition at line 52 of file odbc.h.

◆ SQLROWOFFSET

#define SQLROWOFFSET   SQLLEN

Definition at line 61 of file odbc.h.

◆ SQLROWSETSIZE

#define SQLROWSETSIZE   SQLULEN

Definition at line 65 of file odbc.h.

◆ SQLSETPOSIROW

#define SQLSETPOSIROW   SQLUSMALLINT

Definition at line 57 of file odbc.h.

◆ SQLULEN

#define SQLULEN   SQLUINTEGER

Definition at line 49 of file odbc.h.

◆ sqlwcslen

#define sqlwcslen (   s)    wcslen(s)

Definition at line 719 of file odbc.h.

◆ SQLWSTR

#define SQLWSTR (   s)    ((const wchar_t*)(s))

Definition at line 722 of file odbc.h.

◆ SQLWSTR_BUFS

#define SQLWSTR_BUFS (   n)    do {} while(0)

Definition at line 721 of file odbc.h.

◆ SQLWSTR_FREE

#define SQLWSTR_FREE ( )    do {} while(0)

Definition at line 723 of file odbc.h.

◆ TDS_DONT_DEFINE_DEFAULT_FUNCTIONS

#define TDS_DONT_DEFINE_DEFAULT_FUNCTIONS

Definition at line 24 of file odbc.h.

◆ TDS_MAX_APP_DESC

#define TDS_MAX_APP_DESC   100

Definition at line 278 of file odbc.h.

Typedef Documentation

◆ TDS_CHK

typedef struct _hchk TDS_CHK

Definition at line 148 of file odbc.h.

◆ TDS_DBC

typedef struct _hdbc TDS_DBC

Definition at line 148 of file odbc.h.

◆ TDS_DESC

typedef struct _hdesc TDS_DESC

Definition at line 148 of file odbc.h.

◆ TDS_ENV

typedef struct _henv TDS_ENV

Definition at line 148 of file odbc.h.

◆ TDS_ERRS

typedef struct _sql_errors TDS_ERRS

Definition at line 1 of file odbc.h.

◆ TDS_STMT

typedef struct _hstmt TDS_STMT

Definition at line 148 of file odbc.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ODBC_PARAM_Servername 
ODBC_PARAM_Server 
ODBC_PARAM_DSN 
ODBC_PARAM_UID 
ODBC_PARAM_PWD 
ODBC_PARAM_Address 
ODBC_PARAM_Port 
ODBC_PARAM_TDS_Version 
ODBC_PARAM_Language 
ODBC_PARAM_Database 
ODBC_PARAM_TextSize 
ODBC_PARAM_PacketSize 
ODBC_PARAM_ClientCharset 
ODBC_PARAM_DumpFile 
ODBC_PARAM_DumpFileAppend 
ODBC_PARAM_DebugFlags 
ODBC_PARAM_Encryption 
ODBC_PARAM_Trusted_Connection 
ODBC_PARAM_APP 
ODBC_PARAM_WSID 
ODBC_PARAM_UseNTLMv2 
ODBC_PARAM_MARS_Connection 
ODBC_PARAM_REALM 
ODBC_PARAM_ServerSPN 
ODBC_PARAM_AttachDbFilename 
ODBC_PARAM_ApplicationIntent 
ODBC_PARAM_SIZE 

Definition at line 527 of file odbc.h.

◆ TDS_ODBC_ROW_STATUS

Enumerator
NOT_IN_ROW 
IN_NORMAL_ROW 
IN_COMPUTE_ROW 
AFTER_COMPUTE_ROW 
PRE_NORMAL_ROW 
NOT_IN_ROW 
IN_NORMAL_ROW 
IN_COMPUTE_ROW 
AFTER_COMPUTE_ROW 
PRE_NORMAL_ROW 

Definition at line 371 of file odbc.h.

◆ TDS_ODBC_SPECIAL_ROWS

Enumerator
ODBC_SPECIAL_NONE 
ODBC_SPECIAL_GETTYPEINFO 
ODBC_SPECIAL_COLUMNS 
ODBC_SPECIAL_PROCEDURECOLUMNS 
ODBC_SPECIAL_SPECIALCOLUMNS 
ODBC_SPECIAL_NONE 
ODBC_SPECIAL_GETTYPEINFO 
ODBC_SPECIAL_COLUMNS 
ODBC_SPECIAL_PROCEDURECOLUMNS 
ODBC_SPECIAL_SPECIALCOLUMNS 

Definition at line 380 of file odbc.h.

Function Documentation

◆ _SQLRowCount()

SQLRETURN _SQLRowCount ( SQLHSTMT  hstmt,
SQLINTEGER FAR pcrow 
)

Referenced by _SQLGetDiagField().

◆ continue_parse_prepared_query()

int continue_parse_prepared_query ( struct _hstmt stmt,
SQLPOINTER  DataPtr,
SQLINTEGER  StrLen_or_Ind 
)

Referenced by SQLPutData().

◆ convert_datetime2server()

TDS_INT convert_datetime2server ( int  bindtype,
const void *  src,
TDS_DATETIMEALL dta 
)

Definition at line 40 of file sql2tds.c.

Referenced by _tdsodbc_dbconvert().

◆ desc_alloc()

TDS_DESC* desc_alloc ( SQLHANDLE  parent,
int  desc_type,
int  alloc_type 
)

◆ desc_alloc_records()

SQLRETURN desc_alloc_records ( TDS_DESC desc,
unsigned  count 
)

Definition at line 85 of file descriptor.c.

Referenced by _SQLBindParameter(), _SQLSetDescField(), odbc_populate_ird(), and SQLBindCol().

◆ desc_copy()

SQLRETURN desc_copy ( TDS_DESC dest,
TDS_DESC src 
)

◆ desc_free()

SQLRETURN desc_free ( TDS_DESC desc)

Definition at line 198 of file descriptor.c.

Referenced by _SQLAllocStmt(), _SQLFreeDesc(), _SQLFreeStmt(), and SQLDisconnect().

◆ desc_free_records()

SQLRETURN desc_free_records ( TDS_DESC desc)

Definition at line 134 of file descriptor.c.

Referenced by _SQLFreeStmt(), odbc_populate_ird(), and odbc_prepare().

◆ desc_get_dbc()

TDS_DBC* desc_get_dbc ( TDS_DESC desc)

Definition at line 210 of file descriptor.c.

Referenced by _SQLGetDescRec(), _SQLGetDiagField(), _SQLGetDiagRec(), and _SQLSetDescField().

◆ native_sql()

SQLRETURN native_sql ( struct _hdbc dbc,
DSTR s 
)

Definition at line 325 of file native.c.

Referenced by _SQLNativeSql().

◆ odbc_bcp_batch()

int odbc_bcp_batch ( TDS_DBC dbc)

Commit a set of rows to the table.

Parameters
dbcODBC database connection object
Remarks
If not called, bcp_done() will cause the rows to be saved.
Returns
Count of rows saved, or -1 on error.
See also
odbc_bcp_bind(), odbc_bcp_done(), odbc_bcp_sendrow()

Definition at line 278 of file bcp.c.

Referenced by _SQLSetConnectAttr().

◆ odbc_bcp_bind()

void odbc_bcp_bind ( TDS_DBC dbc,
const void *  varaddr,
int  prefixlen,
int  varlen,
const void *  terminator,
int  termlen,
int  vartype,
int  table_column 
)

Bind a program host variable to a database column.

Parameters
dbcODBC database connection object
varaddraddress of host variable
prefixlenlength of any prefix found at the beginning of varaddr, in bytes. Use zero for fixed-length datatypes.
varlenbytes of data in varaddr. Zero for NULL, -1 for fixed-length datatypes.
terminatorbyte sequence that marks the end of the data in varaddr
termlenlength of terminator
vartypedatatype of the host variable
table_columnNth column, starting at 1, in the table.
Remarks
The order of operation is:
See also
odbc_bcp_batch(), odbc_bcp_done(), odbc_bcp_sendrow()

Definition at line 345 of file bcp.c.

Referenced by _SQLSetConnectAttr().

◆ odbc_bcp_colptr()

void odbc_bcp_colptr ( TDS_DBC dbc,
const void *  colptr,
int  table_column 
)

Override bcp_bind() by pointing to a different host variable.

Parameters
dbcODBC database connection object
colptrThe pointer, the address of your variable.
table_columnThe 1-based column ordinal in the table.
Remarks
Use between calls to bcp_sendrow(). After calling bcp_colptr(), subsequent calls to bcp_sendrow() will bind to the new address.
See also
odbc_bcp_bind(), odbc_bcp_sendrow()

Definition at line 204 of file bcp.c.

Referenced by _SQLSetConnectAttr().

◆ odbc_bcp_control()

void odbc_bcp_control ( TDS_DBC dbc,
int  field,
void *  value 
)

Set BCP options for data transfer.

Parameters
dbcODBC database connection object
fieldsymbolic constant indicating the option to be set, one of:
  • BCPKEEPIDENTITY Enable identity insert, as if by executing 'SET IDENTITY_INSERT table ON'. The default is off
  • BCPHINTS Arbitrary extra text to pass to the server. See the documentation for the bcp command-line tool which came with your database server for the correct syntax.
valueThe value for field.
Remarks
These options control the behavior of bcp_sendrow().
See also
odbc_bcp_batch(), odbc_bcp_init(), odbc_bcp_done()

Definition at line 170 of file bcp.c.

Referenced by _SQLSetConnectAttr().

◆ odbc_bcp_done()

int odbc_bcp_done ( TDS_DBC dbc)

Conclude the transfer of data from program variables.

Parameters
dbcODBC database connection object
Remarks
Do not overlook this function. According to Sybase, failure to call bcp_done() "will result in unpredictable errors".
Returns
As with bcp_batch(), the count of rows saved, or -1 on error.
See also
bcp_batch(), bcp_bind(), bcp_moretext(), bcp_sendrow()

Definition at line 305 of file bcp.c.

Referenced by _SQLSetConnectAttr().

◆ odbc_bcp_free_storage()

void odbc_bcp_free_storage ( TDS_DBC dbc)

Definition at line 674 of file bcp.c.

◆ odbc_bcp_init()

void odbc_bcp_init ( TDS_DBC dbc,
const SQLCHAR tblname,
const SQLCHAR hfile,
const SQLCHAR errfile,
int  direction 
)

Referenced by _SQLSetConnectAttr().

◆ odbc_bcp_sendrow()

void odbc_bcp_sendrow ( TDS_DBC dbc)

Write data in host variables to the table.

Parameters
dbcODBC database connection object
Remarks
Call bcp_bind() first to describe the variables to be used. Use bcp_batch() to commit sets of rows. After sending the last row call bcp_done().
See also
odbc_bcp_batch(), odbc_bcp_bind(), odbc_bcp_colptr(), odbc_bcp_done(), odbc_bcp_init()

Definition at line 236 of file bcp.c.

Referenced by _SQLSetConnectAttr().

◆ odbc_check_struct_extra()

static void odbc_check_struct_extra ( void *  p)
inlinestatic

Definition at line 119 of file odbc.h.

◆ odbc_dstr_copy()

DSTR* odbc_dstr_copy ( TDS_DBC dbc,
DSTR s,
int  size,
const SQLCHAR str 
)

◆ odbc_errs_add()

void odbc_errs_add ( struct _sql_errors errs,
const char *  sqlstate,
const char *  msg 
)

◆ odbc_errs_add_rdbms()

void odbc_errs_add_rdbms ( struct _sql_errors errs,
TDS_UINT  native,
const char *  sqlstate,
const char *  msg,
int  linenum,
int  msgstate,
const char *  server,
int  row 
)

Add an error to list.

This functions is for error that came from server

Definition at line 419 of file error.c.

Referenced by odbc_errmsg_handler().

◆ odbc_errs_reset()

void odbc_errs_reset ( struct _sql_errors errs)

◆ odbc_get_dsn_info()

int odbc_get_dsn_info ( TDS_ERRS errs,
const char *  DSN,
TDSLOGIN login 
)

Read connection information from given DSN.

Parameters
DSNDSN name
loginwhere to store connection info
Returns
1 if success 0 otherwhise

Definition at line 147 of file connectparams.c.

Referenced by _SQLConnect().

◆ odbc_get_param_len()

SQLINTEGER odbc_get_param_len ( const struct _drecord drec_axd,
const struct _drecord drec_ixd,
const TDS_DESC axd,
SQLUSMALLINT  n_row 
)

Referenced by odbc_sql2tds().

◆ odbc_get_string_size()

size_t odbc_get_string_size ( ssize_t  size,
const SQLCHAR str 
)

◆ odbc_parse_connect_string()

int odbc_parse_connect_string ( TDS_ERRS errs,
const char *  connect_string,
const char *  connect_string_end,
TDSLOGIN login,
TDS_PARSED_PARAM parsed_params 
)

Parses a connection string for SQLDriverConnect().

Parameters
connect_stringpoint to connection string
connect_string_endpoint to end of connection string
connectionstructure where to store informations
Returns
0 if error, 1 otherwise

Parses a connection string for SQLDriverConnect().

Parameters
connect_stringconnect string
connect_string_endconnect string end (pointer to char past last)
loginwhere to store connection info
Returns
1 if success 0 otherwhise

Parses a connection string for SQLDriverConnect().

Parameters
connect_stringconnect string
connect_string_endconnect string end (pointer to char past last)
loginwhere to store connection info
Returns
true if success false otherwise

Definition at line 275 of file connectparams.c.

Referenced by _SQLDriverConnect(), parse_wacky_dsn_string(), password_contains_curly_braces(), password_contains_curly_braces_and_separator(), simple_escaped_string(), simple_string(), and test_special_symbols().

◆ odbc_set_sql_type_info()

void odbc_set_sql_type_info ( TDSCOLUMN col,
struct _drecord drec,
SQLINTEGER  odbc_ver 
)

Definition at line 390 of file odbc_data.c.

Referenced by odbc_populate_ird(), and test_type().

◆ odbc_set_stmt_query()

int odbc_set_stmt_query ( struct _hstmt stmt,
const SQLCHAR sql,
ssize_t  sql_len 
)

◆ odbc_skip_rpc_name()

const char* odbc_skip_rpc_name ( const char *  s)

Definition at line 225 of file native.c.

Referenced by _SQLExecute().

◆ odbc_sql2tds()

SQLRETURN odbc_sql2tds ( TDS_STMT stmt,
const struct _drecord drec_ixd,
const struct _drecord drec_axd,
TDSCOLUMN curcol,
int  compute_row,
const TDS_DESC axd,
SQLUSMALLINT  n_row 
)

◆ odbc_tds2sql()

SQLINTEGER odbc_tds2sql ( TDS_STMT stmt,
TDSCOLUMN curcol,
int  srctype,
TDS_CHAR src,
TDS_UINT  srclen,
int  desttype,
TDS_CHAR dest,
SQLUINTEGER  destlen,
const struct _drecord drec_ixd 
)

◆ parse_const_param()

const char* parse_const_param ( const char *  s,
TDS_SERVER_TYPE type 
)

Definition at line 183 of file native.c.

Referenced by prepared_rpc().

◆ parse_prepared_query()

int parse_prepared_query ( struct _hstmt stmt,
int  compute_row 
)

◆ prepare_call()

SQLRETURN prepare_call ( struct _hstmt stmt)

Definition at line 242 of file native.c.

Referenced by _SQLExecDirect(), and _SQLPrepare().

◆ start_parse_prepared_query()

int start_parse_prepared_query ( struct _hstmt stmt,
int  compute_row 
)
Modified on Sat Jun 22 10:44:58 2024 by modify_doxy.py rev. 669887