, "Unknown error"); \
121 #define DEFAULT_QUERY_TIMEOUT (~((SQLUINTEGER) 0)) 139 #if ODBCVER >= 0x0300 146snprintf(unknown, unknown_size,
"unknown: %d", (
int)ret);
150 #define ODBC_PRRET_BUF char unknown_prret_buf[24] 151 #define odbc_prret(ret) odbc_prret(ret, unknown_prret_buf, sizeof(unknown_prret_buf)) 156 #if ENABLE_EXTRA_CHECKS 162 #if ENABLE_EXTRA_CHECKS 163 if(colpos > 0 &&
stmt->tds !=
NULL&& (resinfo =
stmt->tds->current_results) !=
NULL) {
164 if(colpos <= resinfo->num_cols) {
189 if(
dbc->attr.autocommit ==
state)
207 odbc_errs_add(&
dbc->errs,
"HY000",
"Could not change transaction status");
211 odbc_errs_add(&
dbc->errs,
"HY000",
"Could not change transaction status");
240strcpy(
query,
"USE ");
276 switch(txn_isolation) {
278level =
"READ COMMITTED";
281level =
"READ UNCOMMITTED";
284level =
"REPEATABLE READ";
287level =
"SERIALIZABLE";
304sprintf(
query,
"SET TRANSACTION ISOLATION LEVEL %s", level);
355 dbc->attr.packet_size = atoi(newval);
366 #ifdef ENABLE_ODBC_WIDE 370 if(!
dbc->tds_socket)
373 dbc->tds_socket->conn->use_iconv = 0;
382 if(
dbc->attr.connection_timeout)
386 if(
dbc->attr.login_timeout)
391 if(
dbc->attr.bulk_enabled != SQL_BCP_OFF)
394 #ifdef ENABLE_ODBC_WIDE 397 if(
dbc->original_charset_num < 0) {
416 if(
dbc->use_oldpwd) {
429 #ifdef ENABLE_ODBC_WIDE 433 dbc->default_query_timeout =
dbc->tds_socket->query_timeout;
436 dbc->cursor_support = 1;
478 if(!
stmt->need_reprepare ||
stmt->prepared_query_is_rpc
480 stmt->need_reprepare = 0;
494 stmt->param_num = 0;
528 switch(result_type) {
565 stmt->need_reprepare = 0;
586 switch(fDriverCompletion) {
626 odbc_set_dstr(
dbc, szConnStrOut, cbConnStrOutMax, pcbConnStrOut, &conn_str);
654 if(!odbc_build_connect_string(&
dbc->errs, params, &
out))
668 odbc_errs_add(&
dbc->errs,
"IM007",
"Could not find Servername or server parameter");
684hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut);
686 odbc_errs_add(&
dbc->errs,
"HYC00",
"SQLBrowseConnect: function not implemented");
701 "O@table_owner", szSchemaName, cbSchemaName,
"O@table_name", szTableName, cbTableName,
702 "P@column_name", szColumnName, cbColumnName);
716hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable);
718 odbc_errs_add(&
stmt->errs,
"HYC00",
"SQLDescribeParam: function not implemented");
739hstmt, fFetchType, (
int)irow, pcrow, rgfRowStatus);
747tmp_rows =
stmt->ird->header.sql_desc_rows_processed_ptr;
748 stmt->ird->header.sql_desc_rows_processed_ptr = &out_len;
749tmp_status =
stmt->ird->header.sql_desc_array_status_ptr;
750 stmt->ird->header.sql_desc_array_status_ptr = rgfRowStatus;
751tmp_size =
stmt->ard->header.sql_desc_array_size;
752 stmt->ard->header.sql_desc_array_size =
stmt->sql_rowset_size;
753tmp_offset =
stmt->ard->header.sql_desc_bind_offset_ptr;
754 stmt->ard->header.sql_desc_bind_offset_ptr =
NULL;
755tmp_bookmark =
stmt->attr.fetch_bookmark_ptr;
761 stmt->attr.fetch_bookmark_ptr = &bookmark;
769 stmt->ird->header.sql_desc_rows_processed_ptr = tmp_rows;
772 stmt->ird->header.sql_desc_array_status_ptr = tmp_status;
773 stmt->ard->header.sql_desc_array_size = tmp_size;
774 stmt->ard->header.sql_desc_bind_offset_ptr = tmp_offset;
775 stmt->attr.fetch_bookmark_ptr = tmp_bookmark;
790 odbc_stat_execute(
stmt _wide,
"sp_fkeys", 6,
"O@pktable_qualifier", szPkCatalogName, cbPkCatalogName,
"O@pktable_owner",
791szPkSchemaName, cbPkSchemaName,
"O@pktable_name", szPkTableName, cbPkTableName,
792 "O@fktable_qualifier", szFkCatalogName, cbFkCatalogName,
"O@fktable_owner", szFkSchemaName,
793cbFkSchemaName,
"O@fktable_name", szFkTableName, cbFkTableName);
816 if(
stmt->dbc->current_statement ==
NULL 817||
stmt->dbc->current_statement ==
stmt) {
819 stmt->dbc->current_statement =
stmt;
824 stmt->dbc->current_statement->tds =
NULL;
826 stmt->dbc->current_statement =
stmt;
836 stmt->attr.query_timeout :
stmt->dbc->default_query_timeout;
847 if(
stmt->dbc->current_statement !=
NULL 848&&
stmt->dbc->current_statement !=
stmt) {
854 stmt->dbc->current_statement->tds =
NULL;
856 stmt->dbc->current_statement =
stmt;
859 stmt->attr.query_timeout :
stmt->dbc->default_query_timeout;
875 if(
stmt->dbc->current_statement ==
stmt) {
878 stmt->dbc->current_statement =
NULL;
933result_type,
stmt->row_count,
stmt->errs.lastrc);
934 switch(result_type) {
957 switch(
stmt->row_status) {
1003 switch(
stmt->errs.lastrc) {
1011 if(
stmt->curr_param_row <
stmt->num_param_rows) {
1012 if(
stmt->ipd->header.sql_desc_array_status_ptr)
1013 stmt->ipd->header.sql_desc_array_status_ptr[
stmt->curr_param_row] = param_status;
1014++
stmt->curr_param_row;
1015 if(
stmt->ipd->header.sql_desc_rows_processed_ptr)
1016*
stmt->ipd->header.sql_desc_rows_processed_ptr =
stmt->curr_param_row;
1018 if(
stmt->curr_param_row <
stmt->num_param_rows) {
1107*pcpar =
stmt->param_count;
1134szSchemaName, cbSchemaName,
"O@table_name", szTableName, cbTableName);
1151 "O@procedure_qualifier", szCatalogName, cbCatalogName,
1152 "P@procedure_owner", szSchemaName, cbSchemaName,
"P@procedure_name", szProcName, cbProcName,
1153 "P@column_name", szColumnName, cbColumnName,
"V@ODBCVer", (
char*)
NULL, 0);
1175 odbc_stat_execute(
stmt _wide,
"..sp_stored_procedures", 3,
"P@sp_name", szProcName, cbProcName,
"P@sp_owner", szSchemaName,
1176cbSchemaName,
"O@sp_qualifier", szCatalogName, cbCatalogName);
1191 for(
n= 0;
n<
stmt->ird->header.sql_desc_count &&
n<
stmt->ard->header.sql_desc_count; ++
n) {
1195drec_ird = &
stmt->ird->records[
n];
1203params = temp_params;
1239hstmt, (
long) irow, fOption, fLock);
1241 if(!
stmt->dbc->cursor_support) {
1242 odbc_errs_add(&
stmt->errs,
"HYC00",
"SQLSetPos: function not implemented");
1248 if(!
stmt->cursor) {
1315 "P@table_owner", szSchemaName, cbSchemaName,
"P@table_name", szTableName, cbTableName);
1323 #if (ODBCVER >= 0x0300) 1342 env->attr.odbc_version = i_val;
1370henv, (
int)
Attribute,
Value, (
int)BufferLength, StringLength);
1374src = &
env->attr.connection_pooling;
1375 size=
sizeof(
env->attr.connection_pooling);
1378src = &
env->attr.cp_match;
1379 size=
sizeof(
env->attr.cp_match);
1382src = &
env->attr.odbc_version;
1383 size=
sizeof(
env->attr.odbc_version);
1388src = &
env->attr.output_nts;
1389 size=
sizeof(
env->attr.output_nts);
1398*StringLength =
size;
1407 #define IRD_UPDATE(desc, errs, exit) \ 1409 if (desc->type == DESC_IRD && ((TDS_STMT*)desc->parent)->need_reprepare && \ 1410 odbc_update_ird((TDS_STMT*)desc->parent, errs) != SQL_SUCCESS) \ 1425 tdsdump_log(
TDS_DBG_FUNC,
"_SQLBindParameter(%p, %u, %d, %d, %d, %u, %d, %p, %d, %p)\n",
1426hstmt, (
unsigned short)ipar, (
int)fParamType, (
int)fCType, (
int)fSqlType, (
unsigned int)cbColDef,
1427(
int)ibScale, rgbValue, (
int)cbValueMax, pcbValue);
1433 switch(fParamType) {
1444 if(cbValueMax < 0 && cbValueMax !=
SQL_NTS) {
1453 if(cbColDef < 1 || cbColDef > 38) {
1457 if(ibScale < 0 || (
SQLULEN) ibScale > cbColDef) {
1464 if(ipar <= 0 || ipar > 4000) {
1490 if(
stmt->attr.param_focus != 0) {
1511drec = &ipd->
records[
stmt->attr.param_focus - 1];
1530drec = &apd->
records[ipar - 1];
1538 stmt->need_reprepare = 1;
1557drec = &ipd->
records[ipar - 1];
1611 tdsdump_log(
TDS_DBG_FUNC,
"SQLBindParameter(%p, %u, %d, %d, %d, %u, %d, %p, %d, %p)\n",
1612hstmt, (
unsigned)ipar, fParamType, fCType, (
int)fSqlType, (
unsigned)cbColDef, ibScale, rgbValue, (
int)cbValueMax, pcbValue);
1613 return _SQLBindParameter(hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, rgbValue, cbValueMax, pcbValue);
1623hstmt, ipar, fCType, fSqlType, (
unsigned)cbColDef, ibScale, rgbValue, pcbValue);
1627 #if (ODBCVER >= 0x0300) 1633 switch(HandleType) {
1689 dbc->attr.connection_timeout = 0;
1692 dbc->attr.login_timeout = 0;
1695 dbc->attr.packet_size = 0;
1696 dbc->attr.quite_mode =
NULL;
1702 #ifdef ENABLE_ODBC_WIDE 1706 dbc->attr.translate_option = 0;
1709 dbc->attr.bulk_enabled = SQL_BCP_OFF;
1732phenv, (
int) odbc_version);
1739 env->attr.odbc_version = odbc_version;
1753 free(
ctx->locale->datetime_fmt);
1754 ctx->locale->datetime_fmt =
strdup(
"%Y-%m-%d %H:%M:%S.%z");
1755 free(
ctx->locale->date_fmt);
1756 ctx->locale->date_fmt =
strdup(
"%Y-%m-%d");
1757 free(
ctx->locale->time_fmt);
1758 ctx->locale->time_fmt =
strdup(
"%H:%M:%S.%z");
1783 for(
i= 0; ; ++
i) {
1790 if(desc ==
NULL) {
1794 dbc->uad[
i] = desc;
1822 stmt->num_param_rows = 1;
1864 stmt->attr.fetch_bookmark_ptr =
NULL;
1867 stmt->attr.keyset_size = 0;
1868 stmt->attr.max_length = 0;
1869 stmt->attr.max_rows = 0;
1870 stmt->attr.metadata_id =
dbc->attr.metadata_id;
1877 assert(
stmt->ipd->header.sql_desc_rows_processed_ptr ==
NULL);
1878 assert(
stmt->apd->header.sql_desc_array_size == 1);
1881 assert(
stmt->ard->header.sql_desc_array_size == 1);
1884 stmt->attr.row_number = 0;
1887 assert(
stmt->ird->header.sql_desc_rows_processed_ptr ==
NULL);
1892 stmt->attr.qn_timeout = 432000;
1894 stmt->sql_rowset_size = 1;
1900 stmt->next =
dbc->stmt_list;
1901 if(
dbc->stmt_list)
1902 dbc->stmt_list->prev =
stmt;
1911 stmt->attr.param_focus = 0;
1934hstmt, icol, fCType, rgbValue, (
int)cbValueMax, pcbValue);
1954 if(icol <= 0 || icol > 4000) {
1966drec = &ard->
records[icol - 1];
2134 if(cbColNameMax < 0) {
2138drec = &ird->
records[icol - 1];
2141 if(szColName ==
NULL)
2181hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
2185 #define COUT(src) result = odbc_set_string_oct(stmt->dbc, rgbDesc, cbDescMax, pcbDesc, src ? src : "", -1);
2186 #define SOUT(src) result = odbc_set_dstr_oct(stmt->dbc, rgbDesc, cbDescMax, pcbDesc, &src); 2189 #if ENABLE_EXTRA_CHECKS 2190 #define IOUT(type, src) do { \ 2192 type *p_test = &src; p_test = p_test; \ 2193 *pfDesc = src; } while(0) 2195 #define IOUT(type, src) *pfDesc = src 2201 switch(fDescType) {
2202 #if SQL_COLUMN_COUNT != SQL_DESC_COUNT 2220drec = &ird->
records[icol - 1];
2224 switch(fDescType) {
2240 #if SQL_COLUMN_TYPE != SQL_DESC_CONCISE_TYPE 2293 #if SQL_COLUMN_NAME != SQL_DESC_NAME 2299 #if SQL_COLUMN_NULLABLE != SQL_DESC_NULLABLE 2398hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
2403 #if (ODBCVER >= 0x0300) 2407#ifdef TDS_SQLCOLATTRIBUTE_SQLLEN
2419 #ifdef ENABLE_ODBC_WIDE 2423#ifdef TDS_SQLCOLATTRIBUTE_SQLLEN
2431hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
2433 return _SQLColAttribute(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc, 1);
2448 while(
dbc->stmt_list) {
2456 if(
dbc->uad[
i]) {
2462 #ifdef ENABLE_ODBC_WIDE 2468 dbc->cursor_support = 0;
2509}
else if(
ctx->parent) {
2513 intseverity =
msg->severity;
2514 const char*
state=
msg->sql_state;
2518&&
strncmp(
msg->sql_state,
"00", 2) != 0) {
2525 state= severity <= 10 ?
"01000":
"42000";
2529 msg->server,
stmt?
stmt->curr_param_row + 1 : 0);
2532 if(severity <= 10) {
2543 #define DESC_SET_NEED_REPREPARE \ 2545 if (desc->type == DESC_IPD) {\ 2546 assert(IS_HSTMT(desc->parent));\ 2547 ((TDS_STMT *) desc->parent)->need_reprepare = 1;\ 2560 tdsdump_log(
TDS_DBG_FUNC,
"SQLSetDescRec(%p, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n",
2561hdesc, nRecordNumber, nType, nSubType, (
int)nLength, nPrecision, nScale, pData, pnStringLength, pnIndicator);
2568 if(nRecordNumber > desc->header.sql_desc_count || nRecordNumber <= 0) {
2573drec = &desc->records[nRecordNumber - 1];
2583 if(!concise_type) {
2588 if(concise_type != nType) {
2617 if(RecordNumber <= 0) {
2623 if(RecordNumber > desc->header.sql_desc_count)
2626 if(desc->type ==
DESC_IRD&& !desc->header.sql_desc_count) {
2631drec = &desc->records[RecordNumber - 1];
2656 intfocus = desc->
focus;
2657 boolwas_apd =
false;
2669drec = &desc->
records[focus - 1];
2689 #define COUT(src) result = odbc_set_string_oct(desc_get_dbc(desc), Value, BufferLength, StringLength, src, -1); 2690 #define SOUT(src) result = odbc_set_dstr_oct(desc_get_dbc(desc), Value, BufferLength, StringLength, &src); 2692 #if ENABLE_EXTRA_CHECKS 2693 #define IOUT(type, src) do { \ 2695 type *p_test = &src; p_test = p_test; \ 2696 *((type *)Value) = src; \ 2697 *StringLength = sizeof(type); } while(0) 2699 #define IOUT(type, src) do { \ 2700 *((type *)Value) = src; \ 2701 *StringLength = sizeof(type); } while(0) 2705StringLength = &dummy_size;
2710 switch(fDescType) {
2749 odbc_errs_add(&desc->errs,
"07009",
"Column out of range");
2754drec = &fdesc->
records[icol - 1];
2758 switch(fDescType) {
2837 #ifdef SQL_DESC_ROWVER 2900 #if ENABLE_EXTRA_CHECKS 2901 #define IIN(type, dest) do { \ 2903 type *p_test = &dest; p_test = p_test; \ 2904 dest = (type)(TDS_INTPTR)Value; } while(0) 2905 #define PIN(type, dest) do { \ 2907 type *p_test = &dest; p_test = p_test; \ 2908 dest = (type)Value; } while(0) 2910 #define IIN(type, dest) dest = (type)(TDS_INTPTR)Value 2911 #define PIN(type, dest) dest = (type)Value 2923 switch(fDescType) {
2925 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
2948 if(n <= 0 || n > 4000) {
2966 odbc_errs_add(&desc->errs,
"07009",
"Column out of range");
2969drec = &fdesc->
records[icol - 1];
2973 switch(fDescType) {
2979 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
2998 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3005 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3015 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3025 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3050 #ifdef SQL_DESC_ROWVER 3052 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3067 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3077 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3085 odbc_errs_add(&desc->errs,
"HY091",
"Descriptor type read only");
3128 #if ENABLE_EXTRA_CHECKS 3132 #if !ENABLE_ODBC_MARS 3139 if(
stmt->tds->current_results) {
3140res_info =
stmt->tds->current_results;
3174 if(*start !=
'['&& *start !=
'\"') {
3176 if(end < start + buf_len)
3177buf_len = end - start;
3178memcpy(
buf, start, buf_len);
3184quote = (*start ==
'[') ?
']': *start;
3186 while(buf_len > 0 && start < end) {
3187 if(*start == quote)
3190*
buf++ = *start++;
3208 if(!
stmt->tds || !(res_info =
stmt->tds->current_results))
3210 if(res_info ==
stmt->tds->param_info)
3221 for(
i= 0;
i< num_cols;
i++) {
3263 for(
i= 0; ; ++
i) {
3266 if(*p ==
'['|| *p ==
'\"') {
3269pend = strchr(p,
'.');
3271pend = strchr(p, 0);
3273partials[
i].start = p;
3274partials[
i].end = pend;
3276 if(
i== 3 || *p !=
'.')
3340 stmt->cursor = cursor;
3343 switch(
stmt->attr.cursor_type) {
3360 switch(
stmt->attr.concurrency) {
3410memset(
head, 0,
sizeof(*
head));
3411 head->qn_timeout =
stmt->attr.qn_timeout;
3426 intfound_info = 0, found_error = 0;
3437 if(
stmt->params &&
stmt->param_num <= (
int)
stmt->param_count) {
3458 stmt->curr_param_row = 0;
3459 stmt->num_param_rows =
ODBC_MAX(1,
stmt->apd->header.sql_desc_array_size);
3463 if(
stmt->prepared_query_is_rpc) {
3473 stmt->prepared_pos = end - name;
3480}
else if(!
stmt->is_prepared_query) {
3484 if(
stmt->num_param_rows <= 1) {
3485 if(!
stmt->params) {
3498 if(++
stmt->curr_param_row >=
stmt->num_param_rows)
3513 stmt->need_reprepare = 0;
3528 stmt->need_reprepare = 0;
3545 if(
stmt->num_param_rows <= 1) {
3565 if(++
stmt->curr_param_row >=
stmt->num_param_rows)
3586 stmt->curr_param_row = 0;
3594 switch(result_type) {
3604 switch(
stmt->errs.lastrc) {
3614 if(
stmt->curr_param_row <
stmt->num_param_rows &&
stmt->ipd->header.sql_desc_array_status_ptr)
3615 stmt->ipd->header.sql_desc_array_status_ptr[
stmt->curr_param_row] = param_status;
3617++
stmt->curr_param_row;
3624total_rows =
stmt->row_count;
3626total_rows +=
stmt->row_count;
3628 if(
stmt->curr_param_row >=
stmt->num_param_rows) {
3654 if((found_info || found_error) &&
stmt->errs.lastrc !=
SQL_ERROR)
3660 if(found_error &&
stmt->num_param_rows <= 1)
3662 if(
stmt->curr_param_row <
stmt->num_param_rows) {
3663 if(
stmt->ipd->header.sql_desc_array_status_ptr)
3664 stmt->ipd->header.sql_desc_array_status_ptr[
stmt->curr_param_row] = param_status;
3665++
stmt->curr_param_row;
3667total_rows =
stmt->row_count;
3669total_rows +=
stmt->row_count;
3672 if(
stmt->ipd->header.sql_desc_rows_processed_ptr)
3673*
stmt->ipd->header.sql_desc_rows_processed_ptr =
ODBC_MIN(
stmt->curr_param_row,
stmt->num_param_rows);
3676 stmt->row_count = total_rows;
3679 switch(result_type) {
3710 stmt->param_data_called = 0;
3735 if(!
stmt->is_prepared_query) {
3744 stmt->param_data_called = 0;
3745 stmt->curr_param_row = 0;
3785 switch(result_type) {
3818result_type==
TDS_DONE_RESULT?
"TDS_DONE_RESULT":
"TDS_DONEPROC_RESULT");
3861 if(!resinfo || resinfo->
num_cols<= idx)
3864colinfo = resinfo->
columns[idx];
3906 #define AT_ROW(ptr, type) (row_offset ? (type*)(((char*)(ptr)) + row_offset) : &ptr[curr_row]) 3912row_offset = *
stmt->ard->header.sql_desc_bind_offset_ptr;
3932 switch(FetchOrientation) {
3987 if(
stmt->ird->header.sql_desc_count <= 0) {
3994fetched_ptr = &
dummy;
3995 if(
stmt->ird->header.sql_desc_rows_processed_ptr)
3996fetched_ptr =
stmt->ird->header.sql_desc_rows_processed_ptr;
3999status_ptr =
stmt->ird->header.sql_desc_array_status_ptr;
4001 for(
i= 0; (
SQLULEN)
i< num_rows; ++
i)
4003status_ptr =
stmt->ird->header.sql_desc_array_status_ptr;
4011 switch(
stmt->row_status) {
4055 switch(
stmt->special_row) {
4115 if(row_offset || curr_row == 0) {
4116data_ptr += row_offset;
4141 #if SQL_BIND_BY_COLUMN != 0 4144row_offset +=
stmt->ard->header.sql_desc_bind_type;
4145}
while(++curr_row < num_rows);
4152 if(
stmt->cursor) {
4177keep.array_size =
stmt->ard->header.sql_desc_array_size;
4178keep.rows_processed_ptr =
stmt->ird->header.sql_desc_rows_processed_ptr;
4179keep.array_status_ptr =
stmt->ird->header.sql_desc_array_status_ptr;
4182 stmt->ard->header.sql_desc_array_size = 1;
4183 stmt->ird->header.sql_desc_rows_processed_ptr =
NULL;
4184 stmt->ird->header.sql_desc_array_status_ptr =
NULL;
4190 stmt->ard->header.sql_desc_array_size = keep.array_size;
4191 stmt->ird->header.sql_desc_rows_processed_ptr = keep.rows_processed_ptr;
4192 stmt->ird->header.sql_desc_array_status_ptr = keep.array_status_ptr;
4198 #if (ODBCVER >= 0x0300) 4216 #if (ODBCVER >= 0x0300) 4222 switch(HandleType) {
4267 if(
dbc->uad[
i]) {
4375 if(
stmt->dbc->stmt_list ==
stmt)
4376 stmt->dbc->stmt_list =
stmt->next;
4439 if(
IS_HDBC(desc->parent)) {
4447 if(
stmt->ard == desc)
4449 if(
stmt->apd == desc)
4455 if(
dbc->uad[
i] == desc) {
4485 size=
sizeof(
stmt->attr.async_enable);
4486src = &
stmt->attr.async_enable;
4489 size=
sizeof(
stmt->attr.concurrency);
4490src = &
stmt->attr.concurrency;
4493 size=
sizeof(
stmt->attr.cursor_type);
4494src = &
stmt->attr.cursor_type;
4497 size=
sizeof(
stmt->attr.enable_auto_ipd);
4498src = &
stmt->attr.enable_auto_ipd;
4501 size=
sizeof(
stmt->attr.fetch_bookmark_ptr);
4502src = &
stmt->attr.fetch_bookmark_ptr;
4505 size=
sizeof(
stmt->attr.keyset_size);
4506src = &
stmt->attr.keyset_size;
4509 size=
sizeof(
stmt->attr.max_length);
4510src = &
stmt->attr.max_length;
4513 size=
sizeof(
stmt->attr.max_rows);
4514src = &
stmt->attr.max_rows;
4517 size=
sizeof(
stmt->attr.metadata_id);
4518src = &
stmt->attr.metadata_id;
4521 size=
sizeof(
stmt->attr.noscan);
4522src = &
stmt->attr.noscan;
4525 size=
sizeof(
stmt->apd->header.sql_desc_bind_offset_ptr);
4526src = &
stmt->apd->header.sql_desc_bind_offset_ptr;
4529 size=
sizeof(
stmt->apd->header.sql_desc_bind_type);
4530src = &
stmt->apd->header.sql_desc_bind_type;
4533 size=
sizeof(
stmt->apd->header.sql_desc_array_status_ptr);
4534src = &
stmt->apd->header.sql_desc_array_status_ptr;
4537 size=
sizeof(
stmt->ipd->header.sql_desc_array_status_ptr);
4538src = &
stmt->ipd->header.sql_desc_array_status_ptr;
4541 size=
sizeof(
stmt->ipd->header.sql_desc_rows_processed_ptr);
4542src = &
stmt->ipd->header.sql_desc_rows_processed_ptr;
4545 size=
sizeof(
stmt->apd->header.sql_desc_array_size);
4546src = &
stmt->apd->header.sql_desc_array_size;
4549 size=
sizeof(
stmt->attr.query_timeout);
4550src = &
stmt->attr.query_timeout;
4553 size=
sizeof(
stmt->attr.retrieve_data);
4554src = &
stmt->attr.retrieve_data;
4557 size=
sizeof(
stmt->ard->header.sql_desc_bind_offset_ptr);
4558src = &
stmt->ard->header.sql_desc_bind_offset_ptr;
4560 #if SQL_BIND_TYPE != SQL_ATTR_ROW_BIND_TYPE 4564 size=
sizeof(
stmt->ard->header.sql_desc_bind_type);
4565src = &
stmt->ard->header.sql_desc_bind_type;
4573 stmt->attr.row_number = row_number;
4575 size=
sizeof(
stmt->attr.row_number);
4576src = &
stmt->attr.row_number;
4579 size=
sizeof(
stmt->ard->header.sql_desc_array_status_ptr);
4580src = &
stmt->ard->header.sql_desc_array_status_ptr;
4583 size=
sizeof(
stmt->ird->header.sql_desc_array_status_ptr);
4584src = &
stmt->ird->header.sql_desc_array_status_ptr;
4587 size=
sizeof(
stmt->ird->header.sql_desc_rows_processed_ptr);
4588src = &
stmt->ird->header.sql_desc_rows_processed_ptr;
4591 size=
sizeof(
stmt->ard->header.sql_desc_array_size);
4592src = &
stmt->ard->header.sql_desc_array_size;
4595 size=
sizeof(
stmt->attr.simulate_cursor);
4596src = &
stmt->attr.simulate_cursor;
4599 size=
sizeof(
stmt->attr.use_bookmarks);
4600src = &
stmt->attr.use_bookmarks;
4603 size=
sizeof(
stmt->attr.cursor_scrollable);
4604src = &
stmt->attr.cursor_scrollable;
4607 size=
sizeof(
stmt->attr.cursor_sensitivity);
4608src = &
stmt->attr.cursor_sensitivity;
4619 size=
sizeof(
stmt->sql_rowset_size);
4620src = &
stmt->sql_rowset_size;
4623 size=
sizeof(
stmt->attr.qn_timeout);
4624src = &
stmt->attr.qn_timeout;
4644*StringLength =
size;
4649 #if (ODBCVER >= 0x0300) 4654hstmt, (
int)
Attribute,
Value, (
int)BufferLength, StringLength);
4659 #ifdef ENABLE_ODBC_WIDE 4664hstmt, (
int)
Attribute,
Value, (
int)BufferLength, StringLength);
4675hstmt, fOption, pvParam);
4699*pccol =
stmt->ird->header.sql_desc_count;
4716 stmt->is_prepared_query = 1;
4730 if(!
stmt->prepared_query_is_rpc
4735 stmt->param_num = 0;
4736 stmt->need_reprepare = 0;
4744 stmt->need_reprepare = 1;
4757 #if TDS_NO_COUNT != -1 4758 # error TDS_NO_COUNT != -1 4768*pcrow =
stmt->row_count;
4786 if(
stmt->cursor) {
4842 if(
dbc->current_statement) {
4843 dbc->current_statement->tds =
NULL;
4844 dbc->current_statement =
NULL;
4854 odbc_errs_add(&
dbc->errs,
"HY000",
"Could not perform COMMIT or ROLLBACK");
4889 #if ODBCVER >= 0x300 4899 switch(handleType) {
4916hstmt, ipar, fCType, fSqlType, (
unsigned)cbParamDef, ibScale, rgbValue, pcbValue);
4943 const char*
proc=
"sp_columns";
4948 proc=
"..sp_columns";
4952 "P@table_name", szTableName, cbTableName,
"P@table_owner", szSchemaName,
4953cbSchemaName,
"O@table_qualifier", szCatalogName, cbCatalogName,
"P@column_name", szColumnName,
4954cbColumnName,
"V@ODBCVer", (
char*)
NULL, 0);
4971 const char*p =
NULL;
4976hdbc, (
int)
Attribute,
Value, (
int)BufferLength, StringLength);
4982 #if defined(SQL_ATTR_CONNECTION_DEAD) && defined(SQL_CD_TRUE) 5026 caseSQL_COPT_SS_BCP:
5049 #ifdef ENABLE_ODBC_WIDE 5070hstmt, icol, fCType, rgbValue, (
int)cbValueMax, pcbValue);
5072 if(cbValueMax < 0) {
5089pcbValue = &dummy_cb;
5091resinfo =
stmt->cursor ?
stmt->cursor->res_info :
stmt->tds->current_results;
5096 if(icol <= 0 || icol > resinfo->
num_cols) {
5100colinfo = resinfo->
columns[icol - 1];
5120 if(icol >
stmt->ard->header.sql_desc_count) {
5124fCType =
stmt->ard->records[icol - 1].sql_desc_concise_type;
5145&& cbValueMax < *pcbValue) {
5162 switch(fFunction) {
5163 #if (ODBCVER >= 0x0300) 5179 #undef ODBC_COLATTRIBUTE 5181 #if SQL_API_SQLCOLATTRIBUTE != SQL_API_SQLCOLATTRIBUTES 5182 #define ODBC_COLATTRIBUTE(s) s 5184 #define ODBC_COLATTRIBUTE(s) 5187 #define ODBC_ALL_API \ 5188 API_X(SQL_API_SQLALLOCCONNECT)\ 5189 API_X(SQL_API_SQLALLOCENV)\ 5190 API3X(SQL_API_SQLALLOCHANDLE)\ 5191 API_X(SQL_API_SQLALLOCSTMT)\ 5192 API_X(SQL_API_SQLBINDCOL)\ 5193 API_X(SQL_API_SQLBINDPARAM)\ 5194 API_X(SQL_API_SQLBINDPARAMETER)\ 5195 API__(SQL_API_SQLBROWSECONNECT)\ 5196 API3_(SQL_API_SQLBULKOPERATIONS)\ 5197 API_X(SQL_API_SQLCANCEL)\ 5198 API3X(SQL_API_SQLCLOSECURSOR)\ 5199 ODBC_COLATTRIBUTE(API3X(SQL_API_SQLCOLATTRIBUTE))\ 5200 API_X(SQL_API_SQLCOLATTRIBUTES)\ 5201 API_X(SQL_API_SQLCOLUMNPRIVILEGES)\ 5202 API_X(SQL_API_SQLCOLUMNS)\ 5203 API_X(SQL_API_SQLCONNECT)\ 5204 API3X(SQL_API_SQLCOPYDESC)\ 5205 API_X(SQL_API_SQLDESCRIBECOL)\ 5206 API__(SQL_API_SQLDESCRIBEPARAM)\ 5207 API_X(SQL_API_SQLDISCONNECT)\ 5208 API_X(SQL_API_SQLDRIVERCONNECT)\ 5209 API3X(SQL_API_SQLENDTRAN)\ 5210 API_X(SQL_API_SQLERROR)\ 5211 API_X(SQL_API_SQLEXECDIRECT)\ 5212 API_X(SQL_API_SQLEXECUTE)\ 5213 API_X(SQL_API_SQLEXTENDEDFETCH)\ 5214 API_X(SQL_API_SQLFETCH)\ 5215 API3X(SQL_API_SQLFETCHSCROLL)\ 5216 API_X(SQL_API_SQLFOREIGNKEYS)\ 5217 API_X(SQL_API_SQLFREECONNECT)\ 5218 API_X(SQL_API_SQLFREEENV)\ 5219 API3X(SQL_API_SQLFREEHANDLE)\ 5220 API_X(SQL_API_SQLFREESTMT)\ 5221 API3X(SQL_API_SQLGETCONNECTATTR)\ 5222 API_X(SQL_API_SQLGETCONNECTOPTION)\ 5223 API_X(SQL_API_SQLGETCURSORNAME)\ 5224 API_X(SQL_API_SQLGETDATA)\ 5225 API3X(SQL_API_SQLGETDESCFIELD)\ 5226 API3X(SQL_API_SQLGETDESCREC)\ 5227 API3X(SQL_API_SQLGETDIAGFIELD)\ 5228 API3X(SQL_API_SQLGETDIAGREC)\ 5229 API3X(SQL_API_SQLGETENVATTR)\ 5230 API_X(SQL_API_SQLGETFUNCTIONS)\ 5231 API_X(SQL_API_SQLGETINFO)\ 5232 API3X(SQL_API_SQLGETSTMTATTR)\ 5233 API_X(SQL_API_SQLGETSTMTOPTION)\ 5234 API_X(SQL_API_SQLGETTYPEINFO)\ 5235 API_X(SQL_API_SQLMORERESULTS)\ 5236 API_X(SQL_API_SQLNATIVESQL)\ 5237 API_X(SQL_API_SQLNUMPARAMS)\ 5238 API_X(SQL_API_SQLNUMRESULTCOLS)\ 5239 API_X(SQL_API_SQLPARAMDATA)\ 5240 API_X(SQL_API_SQLPARAMOPTIONS)\ 5241 API_X(SQL_API_SQLPREPARE)\ 5242 API_X(SQL_API_SQLPRIMARYKEYS)\ 5243 API_X(SQL_API_SQLPROCEDURECOLUMNS)\ 5244 API_X(SQL_API_SQLPROCEDURES)\ 5245 API_X(SQL_API_SQLPUTDATA)\ 5246 API_X(SQL_API_SQLROWCOUNT)\ 5247 API3X(SQL_API_SQLSETCONNECTATTR)\ 5248 API_X(SQL_API_SQLSETCONNECTOPTION)\ 5249 API_X(SQL_API_SQLSETCURSORNAME)\ 5250 API3X(SQL_API_SQLSETDESCFIELD)\ 5251 API3X(SQL_API_SQLSETDESCREC)\ 5252 API3X(SQL_API_SQLSETENVATTR)\ 5253 API_X(SQL_API_SQLSETPARAM)\ 5254 API_X(SQL_API_SQLSETPOS)\ 5255 API_X(SQL_API_SQLSETSCROLLOPTIONS)\ 5256 API3X(SQL_API_SQLSETSTMTATTR)\ 5257 API_X(SQL_API_SQLSETSTMTOPTION)\ 5258 API_X(SQL_API_SQLSPECIALCOLUMNS)\ 5259 API_X(SQL_API_SQLSTATISTICS)\ 5260 API_X(SQL_API_SQLTABLEPRIVILEGES)\ 5261 API_X(SQL_API_SQLTABLES)\ 5262 API_X(SQL_API_SQLTRANSACT) 5264 #define API_X(n) if (n >= 0 && n < (16*SQL_API_ODBC3_ALL_FUNCTIONS_SIZE)) pfExists[n/16] |= (1 << n%16); 5266 #define API3X(n) if (n >= 0 && n < (16*SQL_API_ODBC3_ALL_FUNCTIONS_SIZE)) pfExists[n/16] |= (1 << n%16); 5278 for(
i= 0;
i< 100; ++
i) {
5282 #define API_X(n) if (n >= 0 && n < 100) pfExists[n] = SQL_TRUE; 5292 #define API_X(n) case n: 5294 #if (ODBCVER >= 0x300) 5295 #define API3X(n) case n: 5320 const char*p =
NULL;
5324 unsigned intsmajor = 6;
5329 dbc, fInfoType, rgbInfoValue, cbInfoValueMax, pcbInfoValue);
5331 #define SIVAL out_len = sizeof(SQLSMALLINT), *((SQLSMALLINT *) rgbInfoValue) 5332 #define USIVAL out_len = sizeof(SQLUSMALLINT), *((SQLUSMALLINT *) rgbInfoValue) 5333 #define IVAL out_len = sizeof(SQLINTEGER), *((SQLINTEGER *) rgbInfoValue) 5334 #define UIVAL out_len = sizeof(SQLUINTEGER), *((SQLUINTEGER *) rgbInfoValue) 5335 #define ULVAL out_len = sizeof(SQLULEN), *((SQLULEN *) rgbInfoValue) 5340 if(is_ms && smajor >= 7)
5344 switch(fInfoType) {
5350 #if (ODBCVER >= 0x0300) 5355 #if (ODBCVER >= 0x0300) 5367 #if (ODBCVER >= 0x0300) 5387 #if (ODBCVER >= 0x0300) 5494 #if (ODBCVER >= 0x0300) 5512 #if (ODBCVER >= 0x0300) 5559 #if (ODBCVER >= 0x0300) 5569 if(!
dbc->tds_socket)
5574 #if (ODBCVER >= 0x0300) 5582 #if (ODBCVER >= 0x0300) 5598p =
"libtdsodbc.so";
5608 #if (ODBCVER >= 0x0300) 5626 if(
dbc->cursor_support)
5654 if(
dbc->cursor_support)
5660 #if (ODBCVER >= 0x0300) 5662 if(
dbc->cursor_support)
5696 #if (ODBCVER >= 0x0300) 5719p =
"BREAK,BROWSE,BULK,CHECKPOINT,CLUSTERED," 5720 "COMMITTED,COMPUTE,CONFIRM,CONTROLROW,DATABASE," 5721 "DBCC,DISK,DISTRIBUTED,DUMMY,DUMP,ERRLVL," 5722 "ERROREXIT,EXIT,FILE,FILLFACTOR,FLOPPY,HOLDLOCK," 5723 "IDENTITY_INSERT,IDENTITYCOL,IF,KILL,LINENO," 5724 "LOAD,MIRROREXIT,NONCLUSTERED,OFF,OFFSETS,ONCE," 5725 "OVER,PERCENT,PERM,PERMANENT,PLAN,PRINT,PROC," 5726 "PROCESSEXIT,RAISERROR,READ,READTEXT,RECONFIGURE," 5727 "REPEATABLE,RETURN,ROWCOUNT,RULE,SAVE,SERIALIZABLE," 5728 "SETUSER,SHUTDOWN,STATISTICS,TAPE,TEMP,TEXTSIZE," 5729 "TRAN,TRIGGER,TRUNCATE,TSEQUEL,UNCOMMITTED," "UPDATETEXT,USE,WAITFOR,WHILE,WRITETEXT";
5735 if(
dbc->cursor_support)
5740 #if (ODBCVER >= 0x0300) 5775 USIVAL= (!is_ms || smajor < 7) ? 30 : 128;
5784 USIVAL= (is_ms && smajor >= 7) ? 134 : 36;
5790 UIVAL= (is_ms && smajor >= 7) ? 8062 : 1962;
5807 USIVAL= (is_ms && smajor >= 7) ? 128 : 30;
5817 USIVAL= (is_ms && smajor >= 7) ? 128 : 30;
5845 #if (ODBCVER >= 0x0300) 5862 #if (ODBCVER >= 0x0300) 5874 #if (ODBCVER >= 0x0300) 5883 if(
dbc->cursor_support)
5895p =
"stored procedure";
5907 #if (ODBCVER >= 0x0300) 5917 if(
dbc->cursor_support)
5924 if(
dbc->cursor_support)
5934p =
dbc->tds_socket->conn->server;
5940 #if (ODBCVER >= 0x0300) 5984 if(
dbc->cursor_support)
6047 if(!
dbc->tds_socket)
6066 if(out_len > 0 && pcbInfoValue)
6067*pcbInfoValue = out_len;
6084hdbc, fInfoType, rgbInfoValue, cbInfoValueMax, pcbInfoValue);
6089 #ifdef ENABLE_ODBC_WIDE 6097hdbc, fInfoType, rgbInfoValue, cbInfoValueMax, pcbInfoValue);
6107 if(
'a'<= *s && *s <=
'z')
6114 #if ENABLE_EXTRA_CHECKS 6123 #if ENABLE_EXTRA_CHECKS 6129 for(icol = 0; icol < resinfo->
num_cols; ++icol) {
6136 for(
n= 0;
n<
len; ++
n, ++p)
6137 if(
'a'<= *p && *p <=
'z')
6196 intvarchar_pos = -1,
n;
6197 static const charsql_templ_default[] =
"sp_datatype_info %d";
6198 const char*sql_templ = sql_templ_default;
6199 char sql[
sizeof(sql_templ_default) + 36];
6210sql_templ =
"sp_datatype_info_100 %d";
6212sql_templ =
"sp_datatype_info_90 %d";
6223sprintf(
sql, sql_templ, fSqlType);
6264 if(
n== (varchar_pos - 1))
6274 if(
n>= varchar_pos && varchar_pos > 0)
6287colinfo = resinfo->
columns[0];
6290name = (
char*) ((
TDSBLOB*) name)->textvalue;
6292 if(colinfo->
column_cur_size== 7 && memcmp(
"varchar", name, 7) == 0) {
6299 #ifdef ENABLE_ODBC_WIDE 6313hstmt, prgbValue,
stmt->param_num,
stmt->param_data_called);
6316&& (
unsigned int)
stmt->param_num <=
stmt->param_count) {
6319 if(
stmt->param_num <= 0 ||
stmt->param_num >
stmt->apd->header.sql_desc_count) {
6321 stmt->param_num,
stmt->apd->header.sql_desc_count);
6331 if(!
stmt->param_data_called) {
6332 stmt->param_data_called = 1;
6333*prgbValue =
stmt->apd->records[
stmt->param_num - 1].sql_desc_data_ptr;
6336++
stmt->param_num;
6339*prgbValue =
stmt->apd->records[
stmt->param_num - 1].sql_desc_data_ptr;
6370 if(
stmt->param_data_called) {
6372 const TDSCOLUMN*curcol =
stmt->params->columns[
stmt->param_num - (
stmt->prepared_query_is_func ? 2 : 1)];
6374 stmt->param_data_called = 1;
6422 if(
dbc->cursor_support)
6452 if(u_value !=
dbc->attr.txn_isolation) {
6473 dbc->use_oldpwd = 1;
6475 caseSQL_COPT_SS_BCP:
6478 caseSQL_COPT_TDSODBC_IMPL_BCP_INITA:
6482 const structtdsodbc_impl_bcp_init_params *params = (
const structtdsodbc_impl_bcp_init_params*)ValuePtr;
6487 #ifdef ENABLE_ODBC_WIDE 6488 caseSQL_COPT_TDSODBC_IMPL_BCP_INITW:
6492 const structtdsodbc_impl_bcp_init_params *params = (
const structtdsodbc_impl_bcp_init_params*)ValuePtr;
6494(
const ODBC_CHAR*) params->errfile, params->direction, 1);
6498 caseSQL_COPT_TDSODBC_IMPL_BCP_CONTROL:
6502 const structtdsodbc_impl_bcp_control_params *params = (
const structtdsodbc_impl_bcp_control_params*)ValuePtr;
6506 caseSQL_COPT_TDSODBC_IMPL_BCP_COLPTR:
6510 const structtdsodbc_impl_bcp_colptr_params *params = (
const structtdsodbc_impl_bcp_colptr_params*)ValuePtr;
6514 caseSQL_COPT_TDSODBC_IMPL_BCP_SENDROW:
6520 caseSQL_COPT_TDSODBC_IMPL_BCP_BATCH:
6524 structtdsodbc_impl_bcp_batch_params *params = (
structtdsodbc_impl_bcp_batch_params*)ValuePtr;
6528 caseSQL_COPT_TDSODBC_IMPL_BCP_DONE:
6532 structtdsodbc_impl_bcp_done_params *params = (
structtdsodbc_impl_bcp_done_params*)ValuePtr;
6536 caseSQL_COPT_TDSODBC_IMPL_BCP_BIND:
6540 const structtdsodbc_impl_bcp_bind_params *params = (
const structtdsodbc_impl_bcp_bind_params*)ValuePtr;
6541 odbc_bcp_bind(
dbc, params->varaddr, params->prefixlen, params->varlen, params->terminator, params->termlen, params->vartype, params->table_column);
6559 #ifdef ENABLE_ODBC_WIDE 6594curr = &
stmt->apd;
6597curr = &
stmt->ard;
6615 if(
stmt->attr.async_enable != ui) {
6622 if(
stmt->attr.concurrency != ui && !
stmt->dbc->cursor_support) {
6627 if(
stmt->cursor) {
6648 if(
stmt->attr.cursor_scrollable != ui && !
stmt->dbc->cursor_support) {
6670 if(
stmt->attr.cursor_sensitivity != ui && !
stmt->dbc->cursor_support) {
6686 if(
stmt->attr.cursor_type != ui && !
stmt->dbc->cursor_support) {
6691 if(
stmt->cursor) {
6720 if(
stmt->attr.enable_auto_ipd != ui) {
6727 stmt->attr.fetch_bookmark_ptr = ValuePtr;
6735 stmt->attr.keyset_size = ui;
6739 if(
stmt->attr.max_length != ui) {
6743 stmt->attr.max_length = ui;
6747 if(
stmt->attr.max_rows != ui) {
6751 stmt->attr.max_rows = ui;
6761 stmt->apd->header.sql_desc_bind_offset_ptr = lp;
6767 stmt->apd->header.sql_desc_array_status_ptr = usip;
6770 stmt->ipd->header.sql_desc_array_status_ptr = usip;
6773 stmt->ipd->header.sql_desc_rows_processed_ptr = ulp;
6777 stmt->apd->header.sql_desc_array_size = ui;
6785 if(
stmt->attr.retrieve_data != ui) {
6792 stmt->ard->header.sql_desc_array_size = ui;
6796 stmt->ard->header.sql_desc_bind_offset_ptr = lp;
6798 #if SQL_BIND_TYPE != SQL_ATTR_ROW_BIND_TYPE 6808 stmt->ard->header.sql_desc_array_status_ptr = usip;
6811 stmt->ird->header.sql_desc_array_status_ptr = usip;
6814 stmt->ird->header.sql_desc_rows_processed_ptr = ulp;
6818 if(
stmt->cursor) {
6822 if(
stmt->attr.simulate_cursor != ui) {
6829 if(
stmt->cursor) {
6840 stmt->sql_rowset_size = ui;
6870 if(ui > 0 && (ui >
stmt->apd->header.sql_desc_count
6876 stmt->orig_apd->focus = (
int) ui;
6877 stmt->ipd->focus = (
int) ui;
6886 #if (ODBCVER >= 0x0300) 6891hstmt, (
int)
Attribute, ValuePtr, (
int)StringLength);
6896 #ifdef ENABLE_ODBC_WIDE 6901hstmt, (
int)
Attribute, ValuePtr, (
int)StringLength);
6922 charnullable, scope, col_type;
6926 tdsdump_log(
TDS_DBG_FUNC,
"SQLSpecialColumns(%p, %d, %p, %d, %p, %d, %p, %d, %d, %d)\n",
6927hstmt, fColType, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, fScope, fNullable);
6949 odbc_errs_add(&
stmt->errs,
"HY009",
"SQLSpecialColumns: The table name parameter is required");
6981cbTableName,
"O", szSchemaName, cbSchemaName,
"O@qualifier", szCatalogName, cbCatalogName,
6982 "!@col_type", &col_type, 1,
"!@scope", &scope, 1,
"!@nullable", &nullable, 1,
6983 "V@ODBCVer", (
char*)
NULL, 0);
6999 charunique, accuracy;
7003 tdsdump_log(
TDS_DBG_FUNC,
"SQLStatistics(%p, %p, %d, %p, %d, %p, %d, %d, %d)\n",
7004hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, fUnique, fAccuracy);
7043szCatalogName, cbCatalogName,
"O@table_owner", szSchemaName, cbSchemaName,
"O@table_name",
7044szTableName, cbTableName,
"!@is_unique", &unique, 1,
"!@accuracy", &accuracy, 1);
7068 tdsdump_log(
TDS_DBG_FUNC,
"SQLTables(%p, %p, %d, %p, %d, %p, %d, %p, %d)\n",
7069hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, szTableType, cbTableType);
7090 proc=
"sp_tables";
7095 proc=
"sp_tableswc";
7108 proc=
"..sp_tables";
7117 const char*
constend = p +
tds_dstr_len(&table_type);
7120 const char*begin = p;
7122p = (
const char*) memchr(p,
',', end - p);
7126 if((p - begin) < 2 || begin[0] !=
'\''|| p[-1] !=
'\'')
7145 const char*begin = p;
7147p = (
const char*) memchr(p,
',', end - p);
7150 if((p - begin) < 2 || begin[0] !=
'\''|| p[-1] !=
'\'') {
7152memcpy(dst, begin, p - begin);
7156memcpy(dst, begin, p - begin);
7172 if(
strcmp(
tds_dstr_cstr(&catalog_name),
"%") == 0 && cbTableName <= 0 && cbSchemaName <= 0) {
7175 "$!P@table_owner",
"", 0,
"!P@table_qualifier",
"%", 1);
7215 const char*name, *category;
7218 #ifdef SQL_ALTER_SCHEMA 7219 caseSQL_ALTER_SCHEMA:
7220name =
"SQL_ALTER_SCHEMA";
7221category =
"Supported SQL";
7224 #ifdef SQL_ANSI_SQL_DATETIME_LITERALS 7225 caseSQL_ANSI_SQL_DATETIME_LITERALS:
7226name =
"SQL_ANSI_SQL_DATETIME_LITERALS";
7227category =
"Supported SQL";
7231name =
"SQL_COLLATION_SEQ";
7232category =
"Data Source Information";
7235name =
"SQL_CONVERT_BIGINT";
7236category =
"Conversion Information";
7239name =
"SQL_CONVERT_DATE";
7240category =
"Conversion Information";
7243name =
"SQL_CONVERT_DOUBLE";
7244category =
"Conversion Information";
7247name =
"SQL_CONVERT_INTERVAL_DAY_TIME";
7248category =
"Conversion Information";
7251name =
"SQL_CONVERT_INTERVAL_YEAR_MONTH";
7252category =
"Conversion Information";
7255name =
"SQL_DM_VER";
7256category =
"Added for ODBC 3.x";
7259name =
"SQL_DRIVER_HDESC";
7260category =
"Driver Information";
7263name =
"SQL_DRIVER_HLIB";
7264category =
"Driver Information";
7266 #ifdef SQL_ODBC_STANDARD_CLI_CONFORMANCE 7267 caseSQL_ODBC_STANDARD_CLI_CONFORMANCE:
7268name =
"SQL_ODBC_STANDARD_CLI_CONFORMANCE";
7269category =
"Driver Information";
7273name =
"SQL_USER_NAME";
7274category =
"Data Source Information";
7279category =
"unknown";
7283 tdsdump_log(
TDS_DBG_INFO1,
"not implemented: %s: option/type %d(%s) [category %s]\n", function_name, fType, name,
7303memcpy(dest, s,
len);
7313 while(
len> 0 && *s ==
' ')
7315 while(
len> 0 && s[
len- 1] ==
' ')
7318 if(
len> 2 && *s ==
'\"'&& s[
len- 1] ==
'\"') {
7344 for(; --
len>= 0; ++s) {
7347 if(unquote &&
prev==
'\"') {
7427 int i, param_qualifier = -1;
7436va_start(marker, nparams);
7437 len= strlen(begin) + 3;
7441 for(
i= 0;
i< nparams; ++
i) {
7444 booladd_always =
false;
7449p = va_arg(marker,
char*);
7472p = va_arg(marker,
char*);
7473param_len = va_arg(marker,
int);
7475 if(
type==
'V') {
7482 #ifdef ENABLE_ODBC_WIDE 7501 if(begin[0] ==
'.'&& strstr(name,
"qualifier")) {
7506param_qualifier =
i;
7516 stmt->prepared_query_is_rpc = 1;
7521 stmt->param_num = 1 +
stmt->param_count;
7522 stmt->params = params;
7532 if(param_qualifier >= 0)
7638hstmt, fConcurrency, (
long int) crowKeyset, crowRowset);
7640 if(!
stmt->dbc->cursor_support) {
7645 if(
stmt->cursor) {
7650 switch(crowKeyset) {
7668 if(crowKeyset > crowRowset) {
7678 switch(fConcurrency) {
7720 const char*errfile,
intdirection);
7722 const SQLWCHAR*errfile,
intdirection);
7724 RETCODE SQL_APIwin_bcp_colptr(
HDBChdbc,
const unsigned char* colptr,
inttable_column);
7728 RETCODE SQL_APIwin_bcp_bind(
HDBChdbc,
const unsigned char* varaddr,
intprefixlen,
intvarlen,
7729 const unsigned char*
terminator,
inttermlen,
intvartype,
inttable_column);
7732win_bcp_initA(
HDBChdbc,
const char*tblname,
const char*hfile,
const char*errfile,
intdirection)
7734 returnbcp_initA(hdbc, tblname, hfile, errfile, direction);
7737 #ifdef ENABLE_ODBC_WIDE 7741 returnbcp_initW(hdbc, tblname, hfile, errfile, direction);
7746win_bcp_control(
HDBChdbc,
intfield,
void*
value)
7752win_bcp_colptr(
HDBChdbc,
const unsigned char* colptr,
inttable_column)
7754 return bcp_colptr(hdbc, colptr, table_column);
7758win_bcp_sendrow(
HDBChdbc)
7764win_bcp_batch(
HDBChdbc)
7770win_bcp_done(
HDBChdbc)
7776win_bcp_bind(
HDBChdbc,
const unsigned char* varaddr,
intprefixlen,
intvarlen,
7777 const unsigned char*
terminator,
inttermlen,
intvartype,
inttable_column)
7779 return bcp_bind(hdbc, varaddr, prefixlen, varlen,
terminator, termlen, vartype, table_column);
std::ofstream out("events_result.xml")
main entry point for tests
static void chk(int check, const char *fmt,...)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
void odbc_bcp_sendrow(TDS_DBC *dbc)
Write data in host variables to the table.
#define odbc_set_string(dbc, buf, buf_len, out_len, s, s_len)
int odbc_bcp_batch(TDS_DBC *dbc)
Commit a set of rows to the table.
SQLRETURN desc_alloc_records(TDS_DESC *desc, unsigned count)
void odbc_bcp_free_storage(TDS_DBC *dbc)
TDS_DBC * desc_get_dbc(TDS_DESC *desc)
void odbc_errs_add(struct _sql_errors *errs, const char *sqlstate, const char *msg)
add an error to list
void odbc_set_sql_type_info(TDSCOLUMN *col, struct _drecord *drec, SQLINTEGER odbc_ver)
#define ODBC_EXIT_(handle)
#define ODBC_RETURN(handle, rc)
#define odbc_dstr_copy_oct
#define ODBC_RETURN_(handle)
#define CHECK_DESC_EXTRA(desc)
SQLRETURN desc_free(TDS_DESC *desc)
#define CHECK_STMT_EXTRA(stmt)
void odbc_errs_reset(struct _sql_errors *errs)
reset errors
DSTR * odbc_dstr_copy(TDS_DBC *dbc, DSTR *s, int size, const SQLCHAR *str)
int parse_prepared_query(struct _hstmt *stmt, int compute_row)
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.
int odbc_get_dsn_info(TDS_ERRS *errs, const char *DSN, TDSLOGIN *login)
Read connection information from given DSN.
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().
int odbc_bcp_done(TDS_DBC *dbc)
Conclude the transfer of data from program variables.
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_SPECIAL_GETTYPEINFO
@ ODBC_SPECIAL_SPECIALCOLUMNS
@ ODBC_SPECIAL_PROCEDURECOLUMNS
int start_parse_prepared_query(struct _hstmt *stmt, int compute_row)
SQLRETURN desc_free_records(TDS_DESC *desc)
SQLRETURN prepare_call(struct _hstmt *stmt)
void odbc_bcp_colptr(TDS_DBC *dbc, const void *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
void odbc_bcp_control(TDS_DBC *dbc, int field, void *value)
Set BCP options for data transfer.
SQLRETURN native_sql(struct _hdbc *dbc, DSTR *s)
const char * odbc_skip_rpc_name(const char *s)
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.
#define odbc_set_string_oct(dbc, buf, buf_len, out_len, s, s_len)
TDS_DESC * desc_alloc(SQLHANDLE parent, int desc_type, int alloc_type)
int odbc_set_stmt_query(struct _hstmt *stmt, const SQLCHAR *sql, ssize_t sql_len)
SQLRETURN desc_copy(TDS_DESC *dest, TDS_DESC *src)
@ ODBC_PARAM_Trusted_Connection
size_t odbc_get_string_size(ssize_t size, const SQLCHAR *str)
#define ODBC_EXIT(handle, rc)
void odbc_bcp_init(TDS_DBC *dbc, const SQLCHAR *tblname, const SQLCHAR *hfile, const SQLCHAR *errfile, int direction)
int continue_parse_prepared_query(struct _hstmt *stmt, SQLPOINTER DataPtr, SQLINTEGER StrLen_or_Ind)
@ TDS_CUR_CONCUR_OPTIMISTIC_VALUES
@ TDS_CUR_CONCUR_READ_ONLY
@ TDS_CUR_CONCUR_SCROLL_LOCKS
@ TDS_CUR_CONCUR_OPTIMISTIC
#define TDS_IS_MSSQL(x)
Check if product is Microsft SQL Server.
#define TDS_DONEPROC_RESULT
enum tds_cursor_operation TDS_CURSOR_OPERATION
#define TDS_ROWFMT_RESULT
tds_sysdep_int32_type TDS_INT
#define tds_get_parent(tds)
#define TDS_MS_VER(maj, min, x)
Calc a version number for mssql.
#define is_variable_type(x)
#define TDS_NO_MORE_RESULTS
#define TDS_IS_SYBASE(x)
Check if product is Sybase (such as Adaptive Server Enterrprice).
tds_sysdep_int64_type TDS_INT8
tds_sysdep_intptr_type TDS_INTPTR
@ TDS_CURSOR_FETCH_RELATIVE
@ TDS_CURSOR_FETCH_ABSOLUTE
#define TDS_COMPUTE_RESULT
@ TDS_CURSOR_STATE_REQUESTED
@ TDS_PENDING
cilent is waiting for data
@ TDS_IDLE
no data expected
tds_sysdep_int16_type TDS_SMALLINT
#define tds_new0(type, n)
@ TDS_DONE_ERROR
error occurred
@ TDS_DONE_COUNT
count field in packet is valid
#define TDS_STATUS_RESULT
enum tds_cursor_fetch TDS_CURSOR_FETCH
#define tds_set_parent(tds, val)
tds_sysdep_uint32_type TDS_UINT
#define TDS_DONEINPROC_RESULT
#define tds_mutex_trylock(x)
#define tds_mutex_free(x)
#define tds_mutex_lock(x)
#define tds_mutex_unlock(x)
#define tds_mutex_init(x)
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetStmtOption(SQLHSTMT hstmt, SQLUSMALLINT fOption, SQLPOINTER pvParam)
SQLRETURN ODBC_PUBLIC ODBC_API SQLBindCol(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLSMALLINT fCType, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN FAR *pcbValue)
SQLRETURN ODBC_PUBLIC ODBC_API SQLNumResultCols(SQLHSTMT hstmt, SQLSMALLINT FAR *pccol)
SQLRETURN ODBC_PUBLIC ODBC_API SQLCloseCursor(SQLHSTMT hstmt)
SQLRETURN ODBC_PUBLIC ODBC_API SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT FAR *pcpar)
SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocConnect(SQLHENV henv, SQLHDBC FAR *phdbc)
SQLRETURN _SQLRowCount(SQLHSTMT hstmt, SQLLEN FAR *pcrow)
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 SQLSetScrollOptions(SQLHSTMT hstmt, SQLUSMALLINT fConcurrency, SQLLEN crowKeyset, SQLUSMALLINT crowRowset)
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)
SQLRETURN ODBC_PUBLIC ODBC_API SQLCopyDesc(SQLHDESC hsrc, SQLHDESC hdesc)
SQLRETURN ODBC_PUBLIC ODBC_API SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLROWOFFSET irow, SQLROWSETSIZE FAR *pcrow, SQLUSMALLINT FAR *rgfRowStatus)
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 SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN FAR *pirow)
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectOption(SQLHDBC hdbc, SQLUSMALLINT fOption, SQLPOINTER pvParam)
SQLRETURN ODBC_PUBLIC ODBC_API SQLTransact(SQLHENV henv, SQLHDBC hdbc, SQLUSMALLINT fType)
SQLRETURN ODBC_PUBLIC ODBC_API SQLFreeStmt(SQLHSTMT hstmt, SQLUSMALLINT fOption)
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 SQLSetStmtOption(SQLHSTMT hstmt, SQLUSMALLINT fOption, SQLULEN vParam)
SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocEnv(SQLHENV FAR *phenv)
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectOption(SQLHDBC hdbc, SQLUSMALLINT fOption, SQLULEN vParam)
SQLRETURN ODBC_PUBLIC ODBC_API SQLRowCount(SQLHSTMT hstmt, SQLLEN FAR *pcrow)
SQLRETURN ODBC_PUBLIC ODBC_API SQLMoreResults(SQLHSTMT hstmt)
SQLRETURN ODBC_PUBLIC ODBC_API SQLDisconnect(SQLHDBC hdbc)
SQLRETURN ODBC_PUBLIC ODBC_API SQLFetch(SQLHSTMT hstmt)
SQLRETURN ODBC_PUBLIC ODBC_API SQLExecute(SQLHSTMT hstmt)
SQLRETURN ODBC_PUBLIC ODBC_API SQLFreeEnv(SQLHENV henv)
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetFunctions(SQLHDBC hdbc, SQLUSMALLINT fFunction, SQLUSMALLINT FAR *pfExists)
SQLRETURN ODBC_PUBLIC ODBC_API SQLParamData(SQLHSTMT hstmt, SQLPOINTER FAR *prgbValue)
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbParamDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN FAR *pcbValue)
SQLRETURN ODBC_PUBLIC ODBC_API SQLPutData(SQLHSTMT hstmt, SQLPOINTER rgbValue, SQLLEN cbValue)
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetTypeInfo(SQLHSTMT hstmt, SQLSMALLINT fSqlType)
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetData(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLSMALLINT fCType, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN FAR *pcbValue)
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetInfo(SQLHDBC hdbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT FAR *pcbInfoValue)
SQLRETURN ODBC_PUBLIC ODBC_API SQLCancel(SQLHSTMT hstmt)
SQLRETURN ODBC_PUBLIC ODBC_API SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock)
SQLRETURN ODBC_PUBLIC ODBC_API SQLAllocStmt(SQLHDBC hdbc, SQLHSTMT FAR *phstmt)
#define ODBC_FUNC(name, params)
static struct lookup_int cursor_type[]
static const char table_name[]
BOOL get_login_info(HWND hwndParent, TDSLOGIN *login)
Use a dialog window to prompt for user_name and password.
#define SQL_COPT_SS_OLDPWD
#define SQL_SS_TIMESTAMPOFFSET
#define SQL_MARS_ENABLED_NO
#define SQL_SOPT_SS_QUERYNOTIFICATION_OPTIONS
#define SQL_COPT_SS_MARS_ENABLED
#define SQL_INFO_FREETDS_TDS_VERSION
#define SQL_SOPT_SS_QUERYNOTIFICATION_TIMEOUT
#define SQL_SOPT_SS_QUERYNOTIFICATION_MSGTEXT
static TDSRET convert(TDSSOCKET *tds, TDSICONV *conv, TDS_ICONV_DIRECTION direction, const char *from, size_t from_len, char *dest, size_t *dest_len)
#define tds_deferred_cursor_dealloc
#define tds_cursor_setrows
#define tds_set_param_type
#define tds_alloc_results
#define tds_deferred_unprepare
#define tds_submit_unprepare
#define tds_submit_begin_tran
#define tds_cursor_declare
#define tds_multiple_query
#define tds_free_param_results
#define tds_submit_commit
#define tds_free_all_results
#define tds_needs_unprepare
#define tds_release_dynamic
#define tds_free_input_params
#define tds_count_placeholders
#define tds_connect_and_login
#define tds_submit_rollback
#define tds_submit_prepare
#define tds71_submit_prepexec
#define tds_alloc_param_result
#define tds_release_cursor
#define tds_cursor_get_cursor_info
#define tds_process_simple_query
#define tds_cursor_dealloc
#define tds_multiple_execute
#define tds_multiple_done
#define tds_alloc_context
#define tds_process_cancel
#define tds_alloc_param_data
#define tds_cursor_setname
#define tds_get_conversion_type
#define tds_multiple_init
#define tds_submit_query_params
#define tds_cursor_update
#define tds_submit_execdirect
#define tds_process_tokens
#define tds_submit_execute
int tds_canonical_charset(const char *charset_name)
Determine canonical iconv character set.
TDSICONV * tds_iconv_get_info(TDSCONNECTION *conn, int canonic_client, int canonic_server)
Get a iconv info structure, allocate and initialize if needed.
SQLTVP * tvp_alloc(TDS_STMT *stmt)
#define odbc_set_dstr_oct(dbc, buf, buf_len, out_len, s)
#define odbc_set_dstr(dbc, buf, buf_len, out_len, s)
SQLINTEGER odbc_tds2sql_col(TDS_STMT *stmt, TDSCOLUMN *curcol, int desttype, TDS_CHAR *dest, SQLUINTEGER destlen, const struct _drecord *drec_ixd)
#define tds_mutex_check_owned(mtx)
#define IRD_UPDATE(desc, errs, exit)
#define ODBC_SAFE_ERROR(stmt)
static SQLRETURN _SQLAllocEnv(SQLHENV FAR *phenv, SQLINTEGER odbc_version)
static size_t odbc_quote_metadata(TDS_DBC *dbc, char type, char *dest, DSTR *dstr)
static SQLRETURN odbc_free_cursor(TDS_STMT *stmt)
Close server cursors.
static SQLRETURN _SQLExecute(TDS_STMT *stmt)
static TDSPARAMINFO * odbc_add_char_param(TDSSOCKET *tds, TDSPARAMINFO *params, const char *name, const char *value, TDS_INT len)
static TDSHEADERS * odbc_init_headers(TDS_STMT *stmt, TDSHEADERS *head)
static SQLRETURN change_database(TDS_DBC *dbc, const char *database, size_t database_len)
static SQLRETURN odbc_connect(TDS_DBC *dbc, TDSLOGIN *login)
static TDSPARAMINFO * odbc_add_int_param(TDSSOCKET *tds, TDSPARAMINFO *params, const char *name, int value)
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 SQLRETURN _SQLFreeConnect(SQLHDBC hdbc)
static SQLRETURN _SQLSetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength)
static SQLRETURN _SQLFreeStmt(SQLHSTMT hstmt, SQLUSMALLINT fOption, int force)
static SQLRETURN odbc_prepare(TDS_STMT *stmt)
static TDS_DESC * desc_get_focused(TDS_DESC *desc)
static SQLRETURN _SQLFetch(TDS_STMT *stmt, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset)
static SQLRETURN odbc_stat_execute(TDS_STMT *stmt _WIDE, const char *begin, int nparams,...)
static SQLRETURN _SQLTransact(SQLHENV henv, SQLHDBC hdbc, SQLUSMALLINT fType)
static SQLRETURN odbc_update_ird(TDS_STMT *stmt, TDS_ERRS *errs)
Update IRD information.
static void odbc_fix_data_type_col(TDS_STMT *stmt, int idx)
static void tds_ascii_strupr(char *s)
#define SQLSetConnectAttr(h, n, p, t)
static SQLRETURN odbc_populate_ird(TDS_STMT *stmt)
#define IS_VALID_LEN(len)
static SQLRETURN _SQLGetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
static int odbc_process_tokens(TDS_STMT *stmt, unsigned flag)
static TDSPARAMINFO * odbc_build_update_params(TDS_STMT *stmt, SQLSETPOSIROW n_row)
static void odbc_col_setname(TDS_STMT *stmt, int colpos, const char *name)
static SQLRETURN change_transaction(TDS_DBC *dbc, int state)
static SQLRETURN _SQLParamData(SQLHSTMT hstmt, SQLPOINTER FAR *prgbValue)
static TDSRET odbc_cursor_execute(TDS_STMT *stmt)
static TDS_DBC * odbc_get_dbc(TDSSOCKET *tds)
static int odbc_lock_statement(TDS_STMT *stmt)
static SQLRETURN _SQLAllocStmt(SQLHDBC hdbc, SQLHSTMT FAR *phstmt)
static SQLRETURN _SQLAllocDesc(SQLHDBC hdbc, SQLHDESC FAR *phdesc)
static SQLSMALLINT odbc_swap_datetime_sql_type(SQLSMALLINT sql_type, int version)
Change sql datatype to a specific version.
static SQLRETURN _SQLFreeDesc(SQLHDESC hdesc)
#define AT_ROW(ptr, type)
static SQLRETURN _SQLColAttribute(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT FAR *pcbDesc, SQLLEN FAR *pfDesc _WIDE)
static SQLRETURN _SQLGetStmtAttr(SQLHSTMT hstmt, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
static void odbc_upper_column_names(TDS_STMT *stmt)
static SQLRETURN odbc_free_dynamic(TDS_STMT *stmt)
static SQLRETURN _SQLFreeEnv(SQLHENV henv)
static int odbc_errmsg_handler(const TDSCONTEXT *ctx, TDSSOCKET *tds, TDSMESSAGE *msg)
#define DESC_SET_NEED_REPREPARE
static SQLRETURN change_autocommit(TDS_DBC *dbc, int state)
static SQLRETURN change_txn(TDS_DBC *dbc, SQLUINTEGER txn_isolation)
static SQLRETURN _SQLAllocConnect(SQLHENV henv, SQLHDBC FAR *phdbc)
static void odbc_unquote(char *buf, size_t buf_len, const char *start, const char *end)
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...
static TDS_STMT * odbc_get_stmt(TDSSOCKET *tds)
static void odbc_unlock_statement(TDS_STMT *stmt)
#define DEFAULT_QUERY_TIMEOUT
static void odbc_env_change(TDSSOCKET *tds, int type, char *oldval, char *newval)
static SQLRETURN _SQLSetStmtAttr(SQLHSTMT hstmt, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength)
static SQLRETURN _SQLGetInfo(TDS_DBC *dbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT FAR *pcbInfoValue _WIDE)
#define SQL_SOPT_SS_PARAM_FOCUS
#define SQL_INFO_FREETDS_SOCKET
#define tds_alloc_additional_socket
static bool is_numeric(const char *)
RETCODE bcp_control(DBPROCESS *dbproc, int field, DBINT value)
Set BCP options for uploading a datafile.
RETCODE bcp_colptr(DBPROCESS *dbproc, BYTE *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
RETCODE bcp_bind(DBPROCESS *dbproc, BYTE *varaddr, int prefixlen, DBINT varlen, BYTE *terminator, int termlen, int db_vartype, int table_column)
Bind a program host variable to a database column.
DBINT bcp_done(DBPROCESS *dbproc)
Conclude the transfer of data from program variables.
DBINT bcp_batch(DBPROCESS *dbproc)
Commit a set of rows to the table.
RETCODE bcp_sendrow(DBPROCESS *dbproc)
Write data in host variables to the table.
DSTR * tds_dstr_setlen(DSTR *s, size_t length)
limit length of string, MUST be <= current length
static const char * tds_dstr_cstr(DSTR *s)
Returns a C version (NUL terminated string) of dstr.
void tds_dstr_zero(DSTR *s)
clear all string filling with zeroes (mainly for security reason)
#define tds_dstr_empty(s)
Make a string empty.
DSTR * tds_dstr_dup(DSTR *s, const DSTR *src) TDS_WUR
Duplicate a string from another dynamic string.
#define DSTR_INITIALIZER
Initializer, used to initialize string like in the following example.
DSTR * tds_dstr_copyn(DSTR *s, const char *src, size_t length) TDS_WUR
Set string to a given buffer of characters.
DSTR * tds_dstr_alloc(DSTR *s, size_t length) TDS_WUR
allocate space for length char
static void tds_dstr_init(DSTR *s)
init a string with empty
static char * tds_dstr_buf(DSTR *s)
Returns a buffer to edit the string.
DSTR * tds_dstr_set(DSTR *s, char *src) TDS_WUR
set a string from another buffer.
void tds_dstr_free(DSTR *s)
free string
DSTR * tds_dstr_copy(DSTR *s, const char *src) TDS_WUR
copy a string from another
static int tds_dstr_isempty(DSTR *s)
test if string is empty
static size_t tds_dstr_len(DSTR *s)
Returns the length of the string in bytes.
unsigned int
A callback function used to compare two keys in a database.
SQLRETURN odbc_set_concise_sql_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
Set concise type and all cascading field.
SQLRETURN odbc_set_concise_c_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)
int odbc_sql_to_c_type_default(int sql_type)
SQLSMALLINT odbc_get_concise_sql_type(SQLSMALLINT type, SQLSMALLINT interval)
void odbc_set_return_status(struct _hstmt *stmt, unsigned int n_row)
SQLINTEGER odbc_get_octet_len(int c_type, const struct _drecord *drec)
void odbc_rdbms_version(TDSSOCKET *tds_socket, char *pversion_string)
Returns the version of the RDBMS in the ODBC format.
SQLSMALLINT odbc_get_concise_c_type(SQLSMALLINT type, SQLSMALLINT interval)
#define TDS_VERSION_SUBVERSION
#define TDS_VERSION_MINOR
#define TDS_VERSION_MAJOR
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
use only n Cassandra database for the lookups</td > n</tr > n< tr > n< td > yes</td > n< td > do not use tables BIOSEQ_INFO and BLOB_PROP in the Cassandra database
if(yy_accept[yy_current_state])
const string version
version string
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
int strncmp(const char *str1, const char *str2, size_t count)
int strcmp(const char *str1, const char *str2)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define SQL_FETCH_ABSOLUTE
#define SQL_ATTR_APP_ROW_DESC
SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength)
#define SQL_OJ_CAPABILITIES
#define SQL_FETCH_DIRECTION
SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength)
#define SQL_STILL_EXECUTING
#define SQL_MAX_USER_NAME_LEN
#define SQL_TXN_REPEATABLE_READ
SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
#define SQL_XOPEN_CLI_YEAR
#define SQL_MAX_INDEX_SIZE
SQLRETURN SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
#define SQL_COLLATION_SEQ
#define SQL_DATA_SOURCE_NAME
SQLRETURN SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1, SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, SQLSMALLINT NameLength3)
#define SQL_DESCRIBE_PARAMETER
#define SQL_SCOPE_TRANSACTION
#define SQL_MAX_COLUMN_NAME_LEN
#define SQL_MAX_COLUMNS_IN_ORDER_BY
#define SQL_MAX_COLUMNS_IN_INDEX
#define SQL_TXN_ISOLATION_OPTION
#define SQL_ATTR_APP_PARAM_DESC
#define SQL_DEFAULT_TXN_ISOLATION
#define SQL_ATTR_CURSOR_SCROLLABLE
#define SQL_IDENTIFIER_CASE
#define SQL_MAX_CATALOG_NAME_LEN
#define SQL_DESC_OCTET_LENGTH_PTR
#define SQL_OJ_NOT_ORDERED
#define SQL_ATTR_IMP_PARAM_DESC
#define SQL_SCCO_READ_ONLY
#define SQL_GETDATA_EXTENSIONS
#define SQL_MAX_CONCURRENT_ACTIVITIES
#define SQL_DESC_DATETIME_INTERVAL_CODE
#define SQL_CURSOR_SENSITIVITY
#define SQL_TYPE_TIMESTAMP
#define SQL_DATA_SOURCE_READ_ONLY
#define SQL_IDENTIFIER_QUOTE_CHAR
#define SQL_MAX_SCHEMA_NAME_LEN
#define SQL_MAX_DRIVER_CONNECTIONS
#define SQL_SCOPE_SESSION
#define SQL_AT_ADD_CONSTRAINT
#define SQL_NONSCROLLABLE
#define SQL_ORDER_BY_COLUMNS_IN_SELECT
SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
#define SQL_DESC_ALLOC_USER
#define SQL_DESC_INDICATOR_PTR
#define SQL_SCCO_OPT_VALUES
#define SQL_DESC_PRECISION
#define SQL_AT_ADD_COLUMN
#define SQL_DESC_DATA_PTR
SQLRETURN SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4)
#define SQL_DESC_ALLOC_AUTO
SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
SQLRETURN SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable)
SQLRETURN SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength)
#define SQL_ATTR_OUTPUT_NTS
#define SQL_NULL_COLLATION
#define SQL_INVALID_HANDLE
SQLRETURN SQLFreeConnect(SQLHDBC ConnectionHandle)
#define SQL_SUCCESS_WITH_INFO
#define SQL_FETCH_RELATIVE
SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType)
#define SQL_TXN_SERIALIZABLE
SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
#define SQL_SPECIAL_CHARACTERS
#define SQL_ATTR_CURSOR_SENSITIVITY
#define SQL_DESC_ALLOC_TYPE
#define SQL_OJ_ALL_COMPARISON_OPS
#define SQL_SCROLL_CONCURRENCY
#define SQL_FD_FETCH_ABSOLUTE
#define SQL_MAX_TABLES_IN_SELECT
#define SQL_FD_FETCH_PRIOR
#define SQL_MAX_COLUMNS_IN_TABLE
#define SQL_TXN_READ_COMMITTED
SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, SQLSMALLINT *SubType, SQLINTEGER *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
#define SQL_MAX_STATEMENT_LEN
#define SQL_MAX_IDENTIFIER_LEN
#define SQL_ACCESSIBLE_PROCEDURES
#define SQL_TXN_READ_UNCOMMITTED
#define SQL_FD_FETCH_NEXT
#define SQL_MAX_COLUMNS_IN_GROUP_BY
SQLRETURN SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
SQLRETURN SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4)
#define SQL_SUCCEEDED(rc)
#define SQL_ATTR_METADATA_ID
#define SQL_MAX_TABLE_NAME_LEN
SQLRETURN SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
#define SQL_DESC_OCTET_LENGTH
#define SQL_MAX_CURSOR_NAME_LEN
SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
#define SQL_ACCESSIBLE_TABLES
#define SQL_FD_FETCH_RELATIVE
#define SQL_FD_FETCH_LAST
SQLRETURN SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset)
#define SQL_ATTR_IMP_ROW_DESC
SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength)
SQLRETURN SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLINTEGER *NumericAttribute)
#define SQL_MAX_COLUMNS_IN_SELECT
#define SQL_FD_FETCH_FIRST
SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength)
#define SQL_SEARCH_PATTERN_ESCAPE
#define SQL_SCCO_OPT_ROWVER
#define SQL_CURSOR_COMMIT_BEHAVIOR
#define SQL_DESC_NULLABLE
#define SQL_SCROLL_STATIC
#define SQL_DESC_TYPE_NAME
#define SQL_FN_STR_SOUNDEX
#define SQL_CU_PROCEDURE_INVOCATION
#define SQL_ATTR_ROWS_FETCHED_PTR
#define SQL_SQL_CONFORMANCE
#define SQL_SQ_QUANTIFIED
#define SQL_FN_SYS_IFNULL
#define SQL_CU_DML_STATEMENTS
#define SQL_ATTR_ROW_ARRAY_SIZE
#define SQL_CONVERT_TIMESTAMP
#define SQL_CONVERT_INTERVAL_DAY_TIME
SQLRETURN SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
#define SQL_CURSOR_FORWARD_ONLY
#define SQL_FN_NUM_CEILING
#define SQL_ATTR_QUIET_MODE
#define SQL_ATTR_CONNECTION_TIMEOUT
#define SQL_INFO_SCHEMA_VIEWS
#define SQL_CONVERT_VARCHAR
#define SQL_ATTR_TXN_ISOLATION
#define SQL_SRVC_ROW_SUBQUERY
#define SQL_CA2_OPT_ROWVER_CONCURRENCY
#define SQL_COLUMN_NULLABLE
#define SQL_AT_ADD_COLUMN_SINGLE
#define SQL_ATTR_ROW_STATUS_PTR
#define SQL_DESC_CATALOG_NAME
#define SQL_QUOTED_IDENTIFIER_CASE
#define SQL_BS_SELECT_EXPLICIT
#define SQL_CONVERT_INTEGER
#define SQL_PARAM_ARRAY_ROW_COUNTS
#define SQL_BOOKMARK_PERSISTENCE
#define SQL_CONVERT_WCHAR
#define SQL_DATETIME_LITERALS
#define SQL_ASYNC_ENABLE_OFF
#define SQL_CVT_LONGVARBINARY
#define SQL_MAX_CHAR_LITERAL_LEN
#define SQL_FILE_NOT_SUPPORTED
#define SQL_STATIC_SENSITIVITY
#define SQL_TIMEDATE_FUNCTIONS
#define SQL_LIKE_ESCAPE_CLAUSE
#define SQL_INDEX_KEYWORDS
#define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE
#define SQL_FN_STR_BIT_LENGTH
#define SQL_ATTR_ROW_OPERATION_PTR
#define SQL_DESC_LOCAL_TYPE_NAME
#define SQL_SRVC_VALUE_EXPRESSION
#define SQL_OU_INDEX_DEFINITION
#define SQL_SRJO_INNER_JOIN
#define SQL_ATTR_PARAMS_PROCESSED_PTR
#define SQL_CA1_POS_POSITION
#define SQL_CV_CHECK_OPTION
#define SQL_CATALOG_NAME_SEPARATOR
#define SQL_CONCUR_VALUES
#define SQL_ATTR_TRANSLATE_LIB
#define SQL_CORRELATION_NAME
#define SQL_DESC_ROWS_PROCESSED_PTR
#define SQL_DESC_LITERAL_PREFIX
#define SQL_DROP_COLLATION
#define SQL_PARAM_BIND_BY_COLUMN
#define SQL_ATTR_SIMULATE_CURSOR
#define SQL_FN_TD_TIMESTAMPADD
#define SQL_CONVERT_NUMERIC
#define SQL_KEYSET_CURSOR_ATTRIBUTES1
#define SQL_API_ODBC3_ALL_FUNCTIONS
#define SQL_CONCUR_READ_ONLY
#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1
#define SQL_ACTIVE_ENVIRONMENTS
#define SQL_FN_TD_EXTRACT
#define SQL_CONVERT_INTERVAL_YEAR_MONTH
#define SQL_CONVERT_BIGINT
#define SQL_OSCC_NOT_COMPLIANT
#define SQL_ATTR_TRANSLATE_OPTION
#define SQL_SC_NON_UNIQUE
#define SQL_CVT_WLONGVARCHAR
#define SQL_FN_STR_REPEAT
SQLRETURN SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, SQLUINTEGER *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable)
#define SQL_FN_STR_LENGTH
#define SQL_FN_TSI_MINUTE
#define SQL_CA1_POS_DELETE
#define SQL_ATTR_LOGIN_TIMEOUT
#define SQL_DRIVER_PROMPT
#define SQL_CURSOR_KEYSET_DRIVEN
#define SQL_ATTR_TRACEFILE
#define SQL_FN_STR_LOCATE_2
#define SQL_CREATE_TRANSLATION
#define SQL_CA1_POSITIONED_DELETE
#define SQL_CVT_LONGVARCHAR
#define SQL_ATTR_ROW_BIND_OFFSET_PTR
#define SQL_TIMEDATE_ADD_INTERVALS
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)
#define SQL_ATTR_PARAM_STATUS_PTR
#define SQL_DESC_DISPLAY_SIZE
#define SQL_PARAM_SUCCESS_WITH_INFO
#define SQL_ATTR_AUTOCOMMIT
#define SQL_FN_TD_DAYOFWEEK
#define SQL_PROCEDURE_TERM
#define SQL_CUR_USE_IF_NEEDED
#define SQL_SQ_CORRELATED_SUBQUERIES
#define SQL_DESC_LITERAL_SUFFIX
#define SQL_ATTR_CONNECTION_DEAD
#define SQL_ATTR_FETCH_BOOKMARK_PTR
#define SQL_CONVERT_LONGVARCHAR
#define SQL_SCC_ISO92_CLI
#define SQL_DROP_TRANSLATION
#define SQL_PS_POSITIONED_UPDATE
SQLRETURN SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName)
#define SQL_FETCH_BOOKMARK
#define SQL_FN_TD_QUARTER
#define SQL_ATTR_CURSOR_TYPE
#define SQL_ATTR_PARAM_OPERATION_PTR
#define SQL_SG_WITH_GRANT_OPTION
#define SQL_CONVERT_WVARCHAR
#define SQL_SRJO_RIGHT_OUTER_JOIN
#define SQL_FN_NUM_DEGREES
SQLRETURN SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr)
#define SQL_API_ALL_FUNCTIONS
#define SQL_DESC_ARRAY_STATUS_PTR
#define SQL_FN_TD_DAYOFYEAR
#define SQL_BS_SELECT_PROC
#define SQL_STRING_FUNCTIONS
#define SQL_ATTR_QUERY_TIMEOUT
#define SQL_PRED_SEARCHABLE
#define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE
#define SQL_AT_CONSTRAINT_NAME_DEFINITION
#define SQL_SCROLL_DYNAMIC
#define SQL_SQL92_PREDICATES
#define SQL_SQL92_VALUE_EXPRESSIONS
#define SQL_DESC_CASE_SENSITIVE
#define SQL_BATCH_SUPPORT
#define SQL_DRIVER_COMPLETE_REQUIRED
#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
#define SQL_CONVERT_FUNCTIONS
#define SQL_GB_GROUP_BY_CONTAINS_SELECT
#define SQL_CREATE_DOMAIN
#define SQL_SQL92_ROW_VALUE_CONSTRUCTOR
#define SQL_CREATE_COLLATION
#define SQL_FN_TD_TIMESTAMPDIFF
#define SQL_DESC_BASE_COLUMN_NAME
#define SQL_ATTR_PARAM_BIND_TYPE
#define SQL_DESC_DATETIME_INTERVAL_PRECISION
#define SQL_STATIC_CURSOR_ATTRIBUTES1
#define SQL_CVT_VARBINARY
#define SQL_FN_SYS_DBNAME
#define SQL_ATTR_ENABLE_AUTO_IPD
#define SQL_ATTR_PACKET_SIZE
#define SQL_SQL92_RELATIONAL_JOIN_OPERATORS
#define SQL_CREATE_ASSERTION
#define SQL_MAX_PROCEDURE_NAME_LEN
#define SQL_OPT_TRACE_OFF
#define SQL_CONVERT_DOUBLE
#define SQL_CU_TABLE_DEFINITION
#define SQL_CA1_POS_UPDATE
#define SQL_TIMEDATE_DIFF_INTERVALS
#define SQL_SCROLL_OPTIONS
#define SQL_DESC_CONCISE_TYPE
#define SQL_CONVERT_FLOAT
#define SQL_AT_ADD_TABLE_CONSTRAINT
#define SQL_SQL92_DATETIME_FUNCTIONS
#define SQL_FN_TD_CURDATE
#define SQL_CT_CREATE_TABLE
#define SQL_MULT_RESULT_SETS
#define SQL_DESC_BASE_TABLE_NAME
#define SQL_ATTR_RETRIEVE_DATA
#define SQL_DRIVER_COMPLETE
#define SQL_CA1_POSITIONED_UPDATE
#define SQL_CREATE_SCHEMA
#define SQL_AUTOCOMMIT_ON
#define SQL_DESC_SEARCHABLE
#define SQL_NON_NULLABLE_COLUMNS
#define SQL_FN_TD_DAYNAME
#define SQL_ATTR_KEYSET_SIZE
#define SQL_SQ_COMPARISON
#define SQL_STANDARD_CLI_CONFORMANCE
#define SQL_ODBC_SAG_CLI_CONFORMANCE
#define SQL_DESC_AUTO_UNIQUE_VALUE
#define SQL_DESC_SCHEMA_NAME
#define SQL_NUMERIC_FUNCTIONS
#define SQL_CURSOR_DYNAMIC
#define SQL_AT_ADD_COLUMN_DEFAULT
#define SQL_MAX_ROW_SIZE_INCLUDES_LONG
#define SQL_STATIC_CURSOR_ATTRIBUTES2
#define SQL_SYSTEM_FUNCTIONS
#define SQL_CVT_TIMESTAMP
#define SQL_AUTOCOMMIT_OFF
#define SQL_DESC_UPDATABLE
#define SQL_LCK_NO_CHANGE
#define SQL_FN_STR_OCTET_LENGTH
#define SQL_FN_TD_DAYOFMONTH
#define SQL_DESC_NUM_PREC_RADIX
#define SQL_CONVERT_BINARY
#define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS
#define SQL_PARAM_INPUT_OUTPUT
#define SQL_CATALOG_USAGE
#define SQL_COLUMN_PRECISION
#define SQL_DESC_BIND_OFFSET_PTR
#define SQL_CONVERT_VARBINARY
#define SQL_ODBC_INTERFACE_CONFORMANCE
#define SQL_MULTIPLE_ACTIVE_TXN
#define SQL_POS_OPERATIONS
#define SQL_CA1_LOCK_NO_CHANGE
#define SQL_BS_ROW_COUNT_PROC
#define SQL_OU_DML_STATEMENTS
#define SQL_OU_PRIVILEGE_DEFINITION
#define SQL_DT_DROP_TABLE
#define SQL_PARAM_ARRAY_SELECTS
#define SQL_OU_TABLE_DEFINITION
SQLRETURN SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
#define SQL_FN_TD_CURRENT_TIMESTAMP
#define SQL_FN_CVT_CONVERT
#define SQL_ATTR_MAX_ROWS
#define SQL_ATTR_ODBC_CURSORS
#define SQL_FN_SYS_USERNAME
#define SQL_CS_AUTHORIZATION
#define SQL_ATTR_ROW_BIND_TYPE
#define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS
#define SQL_FN_TSI_SECOND
#define SQL_DATABASE_NAME
#define SQL_BS_ROW_COUNT_EXPLICIT
#define SQL_CONVERT_WLONGVARCHAR
#define SQL_FN_STR_DIFFERENCE
#define SQL_CS_CREATE_SCHEMA
#define SQL_CURSOR_ROLLBACK_BEHAVIOR
#define SQL_MAX_OPTION_STRING_LENGTH
#define SQL_ATTR_CURRENT_CATALOG
#define SQL_AT_DROP_COLUMN_RESTRICT
#define SQL_CONVERT_DECIMAL
#define SQL_PS_POSITIONED_DELETE
#define SQL_ATTR_CONCURRENCY
#define SQL_ATTR_ACCESS_MODE
#define SQL_DESC_BIND_TYPE
#define SQL_ATTR_PARAMSET_SIZE
#define SQL_FN_TD_MONTHNAME
#define SQL_CURSOR_STATIC
#define SQL_EXPRESSIONS_IN_ORDERBY
#define SQL_SETPARAM_VALUE_MAX
#define SQL_ATTR_PARAM_BIND_OFFSET_PTR
#define SQL_DESC_PARAMETER_TYPE
#define SQL_SO_KEYSET_DRIVEN
#define SQL_CA2_OPT_VALUES_CONCURRENCY
#define SQL_ATTR_ROW_NUMBER
#define SQL_CONVERT_LONGVARBINARY
#define SQL_SRJO_UNION_JOIN
#define SQL_DROP_CHARACTER_SET
#define SQL_MAX_BINARY_LITERAL_LEN
#define SQL_SR_GRANT_OPTION_FOR
#define SQL_INSERT_STATEMENT
#define SQL_DYNAMIC_CURSOR_ATTRIBUTES2
#define SQL_DESC_TABLE_NAME
#define SQL_SC_SQL92_ENTRY
#define SQL_FN_STR_INSERT
#define SQL_FN_NUM_RADIANS
#define SQL_PARAM_SUCCESS
#define SQL_BIND_BY_COLUMN
#define SQL_ODBC_API_CONFORMANCE
#define SQL_SRJO_LEFT_OUTER_JOIN
#define SQL_CA2_LOCK_CONCURRENCY
#define SQL_POSITIONED_STATEMENTS
#define SQL_BATCH_ROW_COUNT
#define SQL_SRJO_FULL_OUTER_JOIN
#define SQL_SRJO_CROSS_JOIN
SQLRETURN SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName)
#define SQL_DESC_ARRAY_SIZE
#define SQL_ATTR_ODBC_VERSION
#define SQL_CATALOG_LOCATION
#define SQL_CONCUR_ROWVER
#define SQL_FN_STR_CONCAT
#define SQL_MODE_READ_WRITE
#define SQL_SCROLL_KEYSET_DRIVEN
#define SQL_ATTR_CP_MATCH
#define SQL_FN_TD_CURRENT_TIME
#define SQL_CONCAT_NULL_BEHAVIOR
#define SQL_CV_CREATE_VIEW
#define SQL_CREATE_CHARACTER_SET
#define SQL_NEED_LONG_DATA_LEN
#define SQL_ATTR_CONNECTION_POOLING
#define SQL_ATTR_ASYNC_ENABLE
SQLRETURN SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName)
#define SQL_CONVERT_TINYINT
#define SQL_KEYSET_CURSOR_ATTRIBUTES2
#define SQL_SO_FORWARD_ONLY
#define SQL_ODBC_SQL_CONFORMANCE
#define SQL_FN_TD_CURRENT_DATE
#define SQL_DRIVER_ODBC_VER
#define SQL_AGGREGATE_FUNCTIONS
#define SQL_ATTR_USE_BOOKMARKS
#define SQL_FN_TSI_QUARTER
#define SQL_CA2_READ_ONLY_CONCURRENCY
#define SQL_SQL92_STRING_FUNCTIONS
#define SQL_COLUMN_LENGTH
#define SQL_DESC_UNSIGNED
#define SQL_SCROLL_FORWARD_ONLY
#define SQL_DRIVER_NOPROMPT
#define SQL_CONVERT_SMALLINT
#define SQL_DESC_FIXED_PREC_SCALE
#define SQL_DROP_ASSERTION
#define SQL_SQL92_FOREIGN_KEY_DELETE_RULE
#define SQL_DYNAMIC_CURSOR_ATTRIBUTES1
#define SQL_FN_TSI_FRAC_SECOND
#define SQL_FN_TD_CURTIME
SQLRETURN SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut, SQLUSMALLINT fDriverCompletion)
#define SQL_FN_STR_SUBSTRING
#define SQL_ATTR_MAX_LENGTH
#define SQL_OU_PROCEDURE_INVOCATION
SQLRETURN SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut)
SQLUINTEGER SQLROWSETSIZE
unsigned long SQLUINTEGER
unsigned short SQLUSMALLINT
signed short int SQLSMALLINT
SQLRETURN SQL_API SQLColAttributeW(SQLHSTMT hstmt, SQLUSMALLINT iCol, SQLUSMALLINT iField, SQLPOINTER pCharAttr, SQLSMALLINT cbCharAttrMax, SQLSMALLINT *pcbCharAttr, SQLLEN *pNumAttr)
SQLRETURN SQL_API SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
SQLRETURN SQL_API SQLSetStmtAttrW(SQLHSTMT hstmt, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax)
SQLRETURN SQL_API SQLGetConnectOptionW(SQLHDBC hdbc, SQLUSMALLINT fOption, SQLPOINTER pvParam)
SQLRETURN SQL_API SQLGetStmtAttrW(SQLHSTMT hstmt, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue)
SQLRETURN SQL_API SQLSetConnectOptionW(SQLHDBC hdbc, SQLUSMALLINT fOption, SQLULEN vParam)
SQLRETURN SQL_API SQLGetInfoW(SQLHDBC hdbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT *pcbInfoValue)
SQLINTEGER * sql_desc_octet_length_ptr
DSTR sql_desc_base_column_name
SQLINTEGER sql_desc_num_prec_radix
SQLUINTEGER sql_desc_auto_unique_value
SQLSMALLINT sql_desc_unnamed
DSTR sql_desc_local_type_name
SQLSMALLINT sql_desc_nullable
SQLSMALLINT sql_desc_updatable
const char * sql_desc_literal_suffix
const char * sql_desc_type_name
DSTR sql_desc_catalog_name
SQLINTEGER * sql_desc_indicator_ptr
SQLINTEGER sql_desc_display_size
SQLSMALLINT sql_desc_rowver
SQLSMALLINT sql_desc_parameter_type
DSTR sql_desc_schema_name
SQLSMALLINT sql_desc_fixed_prec_scale
SQLSMALLINT sql_desc_searchable
SQLINTEGER sql_desc_case_sensitive
SQLINTEGER sql_desc_octet_length
SQLSMALLINT sql_desc_unsigned
SQLUINTEGER sql_desc_length
SQLSMALLINT sql_desc_scale
SQLPOINTER sql_desc_data_ptr
SQLINTEGER sql_desc_datetime_interval_precision
const char * sql_desc_literal_prefix
DSTR sql_desc_base_table_name
SQLSMALLINT sql_desc_precision
SQLSMALLINT sql_desc_datetime_interval_code
SQLSMALLINT sql_desc_type
SQLSMALLINT sql_desc_concise_type
int focus
Nested descriptor to use.
struct _drecord * records
Information about blobs (e.g.
Metadata about columns in regular and compute rows.
unsigned char column_iconv_left
TDS_INT column_size
maximun size of data.
unsigned int column_writeable
TDS_TINYINT column_prec
precision for decimal/numeric
TDS_SERVER_TYPE column_type
This type can be different from wire type because conversion (e.g.
unsigned int column_identity
unsigned int column_nullable
TDS_TINYINT column_scale
scale for decimal/numeric
unsigned char * column_data
struct tds_column::@124 on_server
TDS_INT column_cur_size
size written in variable (ie: char, text, binary).
TDS_INT column_text_sqlgetdatapos
unsigned int column_hidden
TDS_UINT product_version
version of product (Sybase/MS and full version)
Holds informations about a cursor.
TDS_INT cursor_id
cursor id returned by the server after cursor declare
TDS_INT cursor_rows
< number of updatable columns
TDS_INT type
row fetched from this cursor
TDS_CURSOR_STATUS status
cursor parameter
Structure to hold a string.
Holds information for a dynamic (also called prepared) query.
TDSPARAMINFO * params
query parameters.
unsigned int use_new_password
DSTR user_name
account for login
DSTR password
password of account login
DSTR server_name
server name (in freetds.conf)
DSTR new_password
new password to set (TDS 7.2+)
Hold information for any results.
Information for a server connection.
TDS_INT8 rows_affected
rows updated/deleted/inserted/selected, TDS_NO_COUNT if not valid
TDSRESULTINFO * current_results
Current query information.
volatile unsigned char in_cancel
indicate we are waiting a cancel reply; discard tokens till acknowledge; 1 mean we have to send cance...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4