30 #ifndef CPL_ODBC_H_INCLUDED
31 #define CPL_ODBC_H_INCLUDED
46 # define ODBC_FILENAME_MAX PATH_MAX
48 # define ODBC_FILENAME_MAX (255 + 1)
63 char m_szPathOut[ODBC_FILENAME_MAX];
64 char m_szError[SQL_MAX_MESSAGE_LENGTH];
90 int InstallDriver(
const char* pszDriver,
const char* pszPathIn,
91 WORD fRequest = ODBC_INSTALL_COMPLETE );
109 int RemoveDriver(
const char* pszDriverName,
int fRemoveDSN = FALSE );
140 #if defined(_MSC_VER) && !defined(SQLULEN) && !defined(_WIN64)
141 # define MISSING_SQLULEN
145 #if !defined(MISSING_SQLULEN)
147 # define CPL_SQLULEN SQLULEN
148 # define CPL_SQLLEN SQLLEN
150 # define CPL_SQLULEN SQLUINTEGER
151 # define CPL_SQLLEN SQLINTEGER
162 char m_szLastError[SQL_MAX_MESSAGE_LENGTH + 1];
165 int m_bInTransaction;
172 int EstablishSession(
const char *pszDSN,
173 const char *pszUserid,
174 const char *pszPassword );
175 const char *GetLastError();
179 int ClearTransaction();
180 int BeginTransaction();
181 int CommitTransaction();
182 int RollbackTransaction();
190 int Failed(
int, HSTMT = NULL );
211 SQLSMALLINT m_nColCount;
212 char **m_papszColNames;
213 SQLSMALLINT *m_panColType;
214 char **m_papszColTypeNames;
215 CPL_SQLULEN *m_panColSize;
216 SQLSMALLINT *m_panColPrecision;
217 SQLSMALLINT *m_panColNullable;
218 char **m_papszColColumnDef;
220 char **m_papszColValues;
221 CPL_SQLLEN *m_panColValueLengths;
225 char *m_pszStatement;
226 size_t m_nStatementMax;
227 size_t m_nStatementLen;
238 void AppendEscaped(
const char * );
239 void Append(
const char * );
241 void Append(
double );
244 const
char *GetCommand() {
return m_pszStatement; }
246 int ExecuteSQL(
const char * = NULL );
249 int Fetch(
int nOrientation = SQL_FETCH_NEXT,
251 void ClearColumnData();
254 const char *GetColName(
int );
255 short GetColType(
int );
256 const char *GetColTypeName(
int );
257 short GetColSize(
int );
258 short GetColPrecision(
int );
259 short GetColNullable(
int );
260 const char *GetColColumnDef(
int );
262 int GetColId(
const char * );
263 const char *GetColData(
int,
const char * = NULL );
264 const char *GetColData(
const char *,
const char * = NULL );
265 int GetColDataLength(
int );
266 int GetRowCountAffected();
269 int GetColumns(
const char *pszTable,
270 const char *pszCatalog = NULL,
271 const char *pszSchema = NULL );
272 int GetPrimaryKeys(
const char *pszTable,
273 const char *pszCatalog = NULL,
274 const char *pszSchema = NULL );
276 int GetTables(
const char *pszCatalog = NULL,
277 const char *pszSchema = NULL );
279 void DumpResult( FILE *fp,
int bShowSchema = FALSE );
281 static CPLString GetTypeName(
int );
282 static SQLSMALLINT GetTypeMapping( SQLSMALLINT );
284 int CollectResultsInfo();
int IsInTransaction()
Definition: cpl_odbc.h:184
Definition: cpl_odbc.h:161
const char * GetLastError() const
Definition: cpl_odbc.h:124
int GetUsageCount() const
Definition: cpl_odbc.h:112
HDBC GetConnection()
Definition: cpl_odbc.h:192
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:967
DWORD GetLastErrorCode() const
Definition: cpl_odbc.h:131
Definition: cpl_odbc.h:206
Definition: cpl_odbc.h:61
HENV GetEnvironment()
Definition: cpl_odbc.h:194
HSTMT GetStatement()
Definition: cpl_odbc.h:234
#define CPL_FORMAT_STRING(arg)
Definition: cpl_port.h:989
const char * GetPathOut() const
Definition: cpl_odbc.h:118