00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ODBC_UTIL_h
00021 #define ODBC_UTIL_h
00022
00023 #if HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026
00027 #if defined(UNIXODBC) || defined(TDS_NO_DM)
00028 #include <sql.h>
00029 #include <sqlext.h>
00030 #else
00031 #include "isql.h"
00032 #include "isqlext.h"
00033 #endif
00034
00035 static const char rcsid_odbc_util_h[] = "$Id: odbc_util.h,v 1.28 2004/10/28 12:42:12 freddy77 Exp $";
00036 static const void *const no_unused_odbc_util_h_warn[] = { rcsid_odbc_util_h, no_unused_odbc_util_h_warn };
00037
00038 int odbc_set_stmt_query(struct _hstmt *stmt, const char *sql, int sql_len);
00039 int odbc_set_stmt_prepared_query(struct _hstmt *stmt, const char *sql, int sql_len);
00040 void odbc_set_return_status(struct _hstmt *stmt);
00041 void odbc_set_return_params(struct _hstmt *stmt);
00042
00043 SQLSMALLINT odbc_server_to_sql_type(int col_type, int col_size);
00044 int odbc_sql_to_c_type_default(int sql_type);
00045 int odbc_sql_to_server_type(TDSSOCKET * tds, int sql_type);
00046 int odbc_c_to_server_type(int c_type);
00047
00048 void odbc_set_sql_type_info(TDSCOLUMN * col, int odbc_ver, struct _drecord *drec);
00049 SQLINTEGER odbc_sql_to_displaysize(int sqltype, int column_size, int column_prec);
00050 int odbc_get_string_size(int size, SQLCHAR * str);
00051 void odbc_rdbms_version(TDSSOCKET * tds_socket, char *pversion_string);
00052 SQLINTEGER odbc_get_param_len(TDSSOCKET * tds, const struct _drecord *drec_apd, const struct _drecord *drec_ipd);
00053
00054 SQLRETURN odbc_set_string(SQLPOINTER buffer, SQLSMALLINT cbBuffer, SQLSMALLINT FAR * pcbBuffer, const char *s, int len);
00055 SQLRETURN odbc_set_string_i(SQLPOINTER buffer, SQLINTEGER cbBuffer, SQLINTEGER FAR * pcbBuffer, const char *s, int len);
00056
00057 SQLSMALLINT odbc_get_concise_sql_type(SQLSMALLINT type, SQLSMALLINT interval);
00058 SQLRETURN odbc_set_concise_sql_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only);
00059 SQLSMALLINT odbc_get_concise_c_type(SQLSMALLINT type, SQLSMALLINT interval);
00060 SQLRETURN odbc_set_concise_c_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only);
00061
00062 #endif