FreeTDS API

Loading...
Searching...
No Matches
Macros | Functions
ODBC utility
ODBC API

Functions called within `ODBC` driver. More...

Collaboration diagram for ODBC utility:

## Macros
#define | C_TYPES
#define | SQL_TYPES
#define | TYPE_NORMAL_SQL_C_GUID
#define | TYPE_NORMAL_SQL_GUID

## Functions
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.
void | odbc_convert_err_set (struct _sql_errors *errs, TDS_INT err)
DSTR * | odbc_dstr_copy (TDS_DBC *dbc, DSTR *s, int size, const ODBC_CHAR *str)
SQLSMALLINT | odbc_get_concise_c_type (SQLSMALLINT type, SQLSMALLINT interval)
SQLSMALLINT | odbc_get_concise_sql_type (SQLSMALLINT type, SQLSMALLINT interval)
SQLLEN | odbc_get_octet_len (int c_type, const struct _drecord *drec)
SQLINTEGER | odbc_get_param_len (const struct _drecord *drec_axd, const struct _drecord *drec_ixd, const TDS_DESC *axd, unsigned int n_row)
| Return length of parameter from parameter information.
unsigned int | odbc_get_string_size (int size, const ODBC_CHAR *str _WIDE)
void | odbc_rdbms_version (TDSSOCKET *tds, char *pversion_string)
| Returns the version of the RDBMS in the ODBC format.
SQLRETURN | odbc_set_concise_c_type (SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
| Set concise type and all cascading field.
SQLRETURN | odbc_set_concise_sql_type (SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
| Set concise type and all cascading field.
void | odbc_set_return_params (struct _hstmt *stmt, unsigned int n_row)
void | odbc_set_return_status (struct _hstmt *stmt, unsigned int n_row)
SQLRETURN | odbc_set_stmt_query (TDS_STMT *stmt, const ODBC_CHAR *sql, int sql_len _WIDE)
SQLRETURN | odbc_set_string_flag (TDS_DBC *dbc, SQLPOINTER buffer, SQLINTEGER cbBuffer, void FAR *pcbBuffer, const char *s, int len, int flag)
| Copy a string to client setting size according to ODBC convenction.
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)

## Detailed Description

Functions called within `ODBC` driver.

## Function Documentation

## ◆ odbc_c_to_server_type()

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.

This function can return XSYBNVARCHAR or SYBUINTx even if server do not support it

Here is the caller graph for this function:

## ◆ odbc_set_concise_c_type()

SQLRETURN odbc_set_concise_c_type | ( | SQLSMALLINT | concise_type,
|  | struct _drecord * | drec,
|  | int | check_only
| ) |  |

Set concise type and all cascading field.

Parameters

  concise_type | concise type to set
  drec | record to set. NULL to test error without setting
  check_only | it <>0 (true) check only, do not set type

## ◆ odbc_set_concise_sql_type()

SQLRETURN odbc_set_concise_sql_type | ( | SQLSMALLINT | concise_type,
|  | struct _drecord * | drec,
|  | int | check_only
| ) |  |

Set concise type and all cascading field.

Parameters

  concise_type | concise type to set
  drec | record to set. NULL to test error without setting
  check_only | it <>0 (true) check only, do not set type

## ◆ odbc_set_string_flag()

SQLRETURN odbc_set_string_flag | ( | TDS_DBC * | dbc,
|  | SQLPOINTER | buffer,
|  | SQLINTEGER | cbBuffer,
|  | void FAR * | pcbBuffer,
|  | const char * | s,
|  | int | len,
|  | int | flag
| ) |  |

Copy a string to client setting size according to ODBC convenction.

Parameters

  dbc | database connection. Can be NULL
  buffer | client buffer
  cbBuffer | client buffer size (in bytes)
  pcbBuffer | pointer to SQLSMALLINT to hold string size
  s | string to copy
  len | len of string to copy. <0 null terminated
  flag | set of flags. 0x01 wide string in buffer 0x10 pcbBuffer is SQLINTEGER otherwise SQLSMALLINT 0x20 size is in bytes, not characters

Here is the call graph for this function: