1 Index: connectivity/source/inc/odbc/OResultSet.hxx
2 ===================================================================
3 --- connectivity/source/inc/odbc/OResultSet.hxx (revision 274960)
4 +++ connectivity/source/inc/odbc/OResultSet.hxx (working copy)
6 typedef ::std::vector<ORowSetValue> TDataRow;
8 TVoidVector m_aBindVector;
9 - ::std::vector<sal_Int32> m_aLengthVector;
10 + ::std::vector<SQLLEN> m_aLengthVector;
11 ::std::map<sal_Int32,SWORD> m_aODBCColumnTypes;
12 ::com::sun::star::uno::Sequence<sal_Int8> m_aBookmark;
14 Index: connectivity/source/inc/odbc/OResultSetMetaData.hxx
15 ===================================================================
16 --- connectivity/source/inc/odbc/OResultSetMetaData.hxx (revision 274960)
17 +++ connectivity/source/inc/odbc/OResultSetMetaData.hxx (working copy)
19 virtual ~OResultSetMetaData();
22 - static SWORD getNumColAttrib(OConnection* _pConnection
23 + static SQLLEN getNumColAttrib(OConnection* _pConnection
24 ,SQLHANDLE _aStatementHandle
25 ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
27 ,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
29 - static SWORD getColumnODBCType(OConnection* _pConnection
30 + static SQLSMALLINT getColumnODBCType(OConnection* _pConnection
31 ,SQLHANDLE _aStatementHandle
32 ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
34 Index: connectivity/source/inc/odbc/OTools.hxx
35 ===================================================================
36 --- connectivity/source/inc/odbc/OTools.hxx (revision 274960)
37 +++ connectivity/source/inc/odbc/OTools.hxx (working copy)
39 static ::rtl::OUString getStringValue( OConnection* _pConnection,
40 SQLHANDLE _aStatementHandle,
41 sal_Int32 columnIndex,
43 + SQLSMALLINT _fSqlType,
45 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
46 rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
48 static ::com::sun::star::uno::Sequence<sal_Int8> getBytesValue(OConnection* _pConnection,
49 SQLHANDLE _aStatementHandle,
50 sal_Int32 columnIndex,
52 + SQLSMALLINT _fSqlType,
54 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
55 static void getValue( OConnection* _pConnection,
58 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
60 - SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
61 + SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
64 bindData copies the from pValue to pData
66 static void bindData( SQLSMALLINT _nOdbcType,
72 rtl_TextEncoding _nTextEncoding,
73 - SQLUINTEGER& _nColumnSize);
74 + SQLULEN& _nColumnSize);
76 static void bindParameter( OConnection* _pConnection,
84 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
85 rtl_TextEncoding _nTextEncoding,
86 sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
87 Index: connectivity/source/inc/odbc/OStatement.hxx
88 ===================================================================
89 --- connectivity/source/inc/odbc/OStatement.hxx (revision 274960)
90 +++ connectivity/source/inc/odbc/OStatement.hxx (working copy)
93 virtual OResultSet* createResulSet();
95 - sal_Int32 getRowCount () throw( ::com::sun::star::sdbc::SQLException);
96 + SQLLEN getRowCount () throw( ::com::sun::star::sdbc::SQLException);
99 void disposeResultSet();
100 Index: connectivity/source/inc/odbc/OFunctions.hxx
101 ===================================================================
102 --- connectivity/source/inc/odbc/OFunctions.hxx (revision 274960)
103 +++ connectivity/source/inc/odbc/OFunctions.hxx (working copy)
105 SQLSMALLINT * StringLengthPtr,
106 SQLSMALLINT * TypePtr,
107 SQLSMALLINT * SubTypePtr,
108 - SQLINTEGER * LengthPtr,
109 + SQLLEN * LengthPtr,
110 SQLSMALLINT * PrecisionPtr,
111 SQLSMALLINT * ScalePtr,
112 SQLSMALLINT * NullablePtr);
114 SQLSMALLINT Precision,
117 - SQLINTEGER * StringLengthPtr,
118 - SQLINTEGER * IndicatorPtr);
119 + SQLLEN * StringLengthPtr,
120 + SQLLEN * IndicatorPtr);
122 #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j)
124 @@ -221,11 +221,11 @@
125 SQLSMALLINT InputOutputType,
126 SQLSMALLINT ValueType,
127 SQLSMALLINT ParameterType,
128 - SQLUINTEGER ColumnSize,
129 + SQLULEN ColumnSize,
130 SQLSMALLINT DecimalDigits,
131 SQLPOINTER ParameterValuePtr,
132 - SQLINTEGER BufferLength,
133 - SQLINTEGER * StrLen_or_IndPtr);
134 + SQLLEN BufferLength,
135 + SQLLEN * StrLen_or_IndPtr);
137 #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j)
140 typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle,
141 SQLUSMALLINT ParameterNumber,
142 SQLSMALLINT * DataTypePtr,
143 - SQLUINTEGER * ParameterSizePtr,
144 + SQLULEN * ParameterSizePtr,
145 SQLSMALLINT * DecimalDigitsPtr,
146 SQLSMALLINT * NullablePtr);
148 @@ -284,13 +284,13 @@
150 typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle,
152 - SQLINTEGER StrLen_or_Ind);
153 + SQLLEN StrLen_or_Ind);
155 #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c)
157 // Retrieving results and information about results
158 typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle,
159 - SQLINTEGER * RowCountPtr);
160 + SQLLEN * RowCountPtr);
162 #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b)
164 @@ -300,12 +300,12 @@
165 #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b)
167 typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle,
168 - SQLSMALLINT ColumnNumber,
169 + SQLUSMALLINT ColumnNumber,
170 SQLCHAR * ColumnName,
171 SQLSMALLINT BufferLength,
172 SQLSMALLINT * NameLengthPtr,
173 SQLSMALLINT * DataTypePtr,
174 - SQLUINTEGER * ColumnSizePtr,
175 + SQLULEN * ColumnSizePtr,
176 SQLSMALLINT * DecimalDigitsPtr,
177 SQLSMALLINT * NullablePtr);
180 SQLPOINTER CharacterAttributePtr,
181 SQLSMALLINT BufferLength,
182 SQLSMALLINT * StringLengthPtr,
183 - SQLPOINTER NumericAttributePtr);
184 + SQLLEN * NumericAttributePtr);
186 #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g)
189 SQLUSMALLINT ColumnNumber,
190 SQLSMALLINT TargetType,
191 SQLPOINTER TargetValuePtr,
192 - SQLINTEGER BufferLength,
193 - SQLINTEGER * StrLen_or_IndPtr);
194 + SQLLEN BufferLength,
195 + SQLLEN * StrLen_or_IndPtr);
197 #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f)
201 typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle,
202 SQLSMALLINT FetchOrientation,
203 - SQLINTEGER FetchOffset);
204 + SQLLEN FetchOffset);
206 #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c)
208 @@ -344,20 +344,20 @@
209 SQLUSMALLINT ColumnNumber,
210 SQLSMALLINT TargetType,
211 SQLPOINTER TargetValuePtr,
212 - SQLINTEGER BufferLength,
213 - SQLINTEGER * StrLen_or_IndPtr);
214 + SQLLEN BufferLength,
215 + SQLLEN * StrLen_or_IndPtr);
217 #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f)
219 typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle,
220 - SQLUSMALLINT RowNumber,
221 + SQLSETPOSIROW RowNumber,
222 SQLUSMALLINT Operation,
223 SQLUSMALLINT LockType);
225 #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d)
227 typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle,
228 - SQLUSMALLINT Operation);
229 + SQLSMALLINT Operation);
231 #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b)
233 @@ -461,15 +461,15 @@
234 #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g)
236 typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle,
237 - SQLSMALLINT IdentifierType,
238 + SQLUSMALLINT IdentifierType,
239 SQLCHAR * CatalogName,
240 SQLSMALLINT NameLength1,
241 SQLCHAR * SchemaName,
242 SQLSMALLINT NameLength2,
244 SQLSMALLINT NameLength3,
246 - SQLSMALLINT Nullable);
247 + SQLUSMALLINT Scope,
248 + SQLUSMALLINT Nullable);
250 #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j)
252 Index: connectivity/source/drivers/odbcbase/OConnection.cxx
253 ===================================================================
254 --- connectivity/source/drivers/odbcbase/OConnection.cxx (revision 274960)
255 +++ connectivity/source/drivers/odbcbase/OConnection.cxx (working copy)
257 SQLRETURN nSQLRETURN = 0;
258 SDB_ODBC_CHAR szConnStrOut[4096];
259 SDB_ODBC_CHAR szConnStrIn[2048];
260 - SWORD cbConnStrOut;
261 + SQLSMALLINT cbConnStrOut;
262 memset(szConnStrOut,'\0',4096);
263 memset(szConnStrIn,'\0',2048);
264 ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding()));
265 Index: connectivity/source/drivers/odbcbase/OTools.cxx
266 ===================================================================
267 --- connectivity/source/drivers/odbcbase/OTools.cxx (revision 274960)
268 +++ connectivity/source/drivers/odbcbase/OTools.cxx (working copy)
271 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
273 - SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
274 + SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
276 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getValue" );
277 - SQLINTEGER pcbValue = SQL_NULL_DATA;
278 + SQLLEN pcbValue = SQL_NULL_DATA;
279 OTools::ThrowException(_pConnection,
280 (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
281 (SQLUSMALLINT)columnIndex,
284 - (SQLINTEGER)_rSize,
287 _aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False);
288 _bWasNull = pcbValue == SQL_NULL_DATA;
291 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindParameter" );
295 - SDWORD nMaxLen = 0;
296 + SQLSMALLINT fSqlType;
297 + SQLSMALLINT fCType;
298 + SQLLEN nMaxLen = 0;
299 // void*& pData = pDataBuffer;
300 - SQLINTEGER* pLen = (SQLINTEGER*)pLenBuffer;
301 - SQLUINTEGER nColumnSize=0;
302 + SQLLEN* pLen = (SQLLEN*)pLenBuffer;
303 + SQLULEN nColumnSize=0;
304 SQLSMALLINT nDecimalDigits=0;
306 OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType);
307 @@ -123,10 +123,10 @@
308 void OTools::bindData( SQLSMALLINT _nOdbcType,
314 rtl_TextEncoding _nTextEncoding,
315 - SQLUINTEGER& _nColumnSize)
316 + SQLULEN& _nColumnSize)
318 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindData" );
323 nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
324 - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
325 + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
328 case SQL_LONGVARCHAR:
329 @@ -235,21 +235,21 @@
330 ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding));
331 nLen = aString.getLength();
333 - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
334 + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
337 *(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue;
338 - *pLen = (SDWORD)sizeof(DATE_STRUCT);
339 + *pLen = (SQLLEN)sizeof(DATE_STRUCT);
343 *(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue;
344 - *pLen = (SDWORD)sizeof(TIME_STRUCT);
345 + *pLen = (SQLLEN)sizeof(TIME_STRUCT);
349 *(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue;
350 - *pLen = (SDWORD)sizeof(TIMESTAMP_STRUCT);
351 + *pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT);
356 SQLSMALLINT _nMaxLen,
361 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
362 rtl_TextEncoding _nTextEncoding,
363 sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
366 SQLSMALLINT fSqlType;
368 - SQLSMALLINT nMaxLen = _nMaxLen;
369 + SQLLEN nMaxLen = _nMaxLen;
371 OTools::getBindTypes( sal_False,
374 _pData = (void*)(columnIndex);
376 nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength();
377 - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
378 + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
381 case SQL_LONGVARCHAR:
383 _pData = (void*)(columnIndex);
385 nLen = ((::rtl::OUString*)_pValue)->getLength();
386 - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen);
387 + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen);
390 *pLen = sizeof(DATE_STRUCT);
391 @@ -446,10 +446,10 @@
392 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::ThrowException" );
394 SDB_ODBC_CHAR szSqlState[5];
395 - SDWORD pfNativeError;
396 + SQLINTEGER pfNativeError;
397 SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH];
398 szErrorMessage[0] = '\0';
399 - SWORD pcbErrorMsg = 0;
400 + SQLSMALLINT pcbErrorMsg = 0;
402 // Informationen zur letzten Operation:
403 // wenn hstmt != SQL_NULL_HSTMT ist (Benutzung von SetStatus in SdbCursor, SdbTable, ...),
405 Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
406 SQLHANDLE _aStatementHandle,
407 sal_Int32 columnIndex,
409 + SQLSMALLINT _fSqlType,
411 const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
413 @@ -486,14 +486,14 @@
414 char aCharArray[2048];
415 // Erstmal versuchen, die Daten mit dem kleinen Puffer
417 - SQLINTEGER nMaxLen = sizeof aCharArray - 1;
418 + SQLLEN nMaxLen = sizeof aCharArray - 1;
419 // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
420 - SQLINTEGER pcbValue = 0;
421 + SQLLEN pcbValue = 0;
422 OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
423 (SQLUSMALLINT)columnIndex,
425 (SQLPOINTER)aCharArray,
426 - (SQLINTEGER)nMaxLen,
429 _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
432 ::rtl::OUString OTools::getStringValue(OConnection* _pConnection,
433 SQLHANDLE _aStatementHandle,
434 sal_Int32 columnIndex,
436 + SQLSMALLINT _fSqlType,
438 const Reference< XInterface >& _xInterface,
439 rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
440 @@ -555,15 +555,15 @@
442 sal_Unicode waCharArray[2048];
443 // read the unicode data
444 - sal_Int32 nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
445 + SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1;
446 // GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode));
448 - SQLINTEGER pcbValue=0;
450 OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
451 (SQLUSMALLINT)columnIndex,
454 - (SQLINTEGER)nMaxLen*sizeof(sal_Unicode),
455 + (SQLLEN)nMaxLen*sizeof(sal_Unicode),
457 _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
458 _bWasNull = pcbValue == SQL_NULL_DATA;
459 @@ -571,9 +571,9 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
460 return ::rtl::OUString();
461 // Bei Fehler bricht der GETDATA-Makro mit return ab,
462 // bei NULL mit break!
463 - SQLINTEGER nRealSize = 0;
464 + SQLLEN nRealSize = 0;
466 nRealSize = pcbValue / sizeof(sal_Unicode);
467 - SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
468 + SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1);
469 waCharArray[nLen] = 0;
470 aData.append(waCharArray,nLen);
472 (SQLUSMALLINT)columnIndex,
475 - (SQLINTEGER)nLen+1,
478 _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
479 nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
480 @@ -610,21 +610,21 @@
481 char aCharArray[2048];
482 // Erstmal versuchen, die Daten mit dem kleinen Puffer
484 - SDWORD nMaxLen = sizeof aCharArray - 1;
485 + SQLLEN nMaxLen = sizeof aCharArray - 1;
486 // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
487 - SQLINTEGER pcbValue = 0;
488 + SQLLEN pcbValue = 0;
489 OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
490 (SQLUSMALLINT)columnIndex,
493 - (SQLINTEGER)nMaxLen,
496 _aStatementHandle,SQL_HANDLE_STMT,_xInterface);
497 _bWasNull = pcbValue == SQL_NULL_DATA;
499 return ::rtl::OUString();
501 - SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
502 + SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1);
503 aCharArray[nLen] = 0;
504 if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 )
506 Index: connectivity/source/drivers/odbcbase/OStatement.cxx
507 ===================================================================
508 --- connectivity/source/drivers/odbcbase/OStatement.cxx (revision 274960)
509 +++ connectivity/source/drivers/odbcbase/OStatement.cxx (working copy)
510 @@ -250,13 +250,13 @@
511 m_xResultSet = Reference< XResultSet >();
513 //--------------------------------------------------------------------
514 -sal_Int32 OStatement_Base::getRowCount () throw( SQLException)
515 +SQLLEN OStatement_Base::getRowCount () throw( SQLException)
517 ::osl::MutexGuard aGuard( m_aMutex );
518 checkDisposed(OStatement_BASE::rBHelper.bDisposed);
521 - sal_Int32 numRows = 0;
522 + SQLLEN numRows = 0;
525 THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows));
527 SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle);
528 if(nError == SQL_SUCCESS)
530 - N3SQLRowCount(m_aStatementHandle,&pArray[j]);
531 + SQLLEN nRowCount=0;
532 + N3SQLRowCount(m_aStatementHandle,&nRowCount);
533 + pArray[j] = nRowCount;
537 Index: connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
538 ===================================================================
539 --- connectivity/source/drivers/odbcbase/OPreparedStatement.cxx (revision 274960)
540 +++ connectivity/source/drivers/odbcbase/OPreparedStatement.cxx (working copy)
541 @@ -446,11 +446,11 @@
542 checkParameterIndex(parameterIndex);
544 sal_Int8* lenBuf = getLengthBuf (parameterIndex);
545 - *(SDWORD*)lenBuf = SQL_NULL_DATA;
546 + *(SQLLEN*)lenBuf = SQL_NULL_DATA;
549 - SQLINTEGER prec = 0;
550 - SQLUINTEGER nColumnSize = 0;
552 + SQLULEN nColumnSize = 0;
553 if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR)
563 OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
567 // Bind the parameter with SQL_LEN_DATA_AT_EXEC
568 SQLSMALLINT Ctype = SQL_C_CHAR;
569 - SDWORD atExec = SQL_LEN_DATA_AT_EXEC (length);
570 + SQLLEN atExec = SQL_LEN_DATA_AT_EXEC (length);
571 memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex));
572 memcpy (lenBuf, &atExec, sizeof (atExec));
574 @@ -872,14 +872,14 @@
575 OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
576 N3SQLBindParameter(m_aStatementHandle,
577 (SQLUSMALLINT)ParameterIndex,
578 - (SQLSMALLINT)SQL_PARAM_INPUT,
579 + (SQLUSMALLINT)SQL_PARAM_INPUT,
581 (SQLSMALLINT)SQLtype,
582 - (SQLUINTEGER)length,
586 sizeof(ParameterIndex),
590 // Save the input stream
591 boundParams[ParameterIndex - 1].setInputStream (x, length);
592 Index: connectivity/source/drivers/odbcbase/OResultSet.cxx
593 ===================================================================
594 --- connectivity/source/drivers/odbcbase/OResultSet.cxx (revision 274960)
595 +++ connectivity/source/drivers/odbcbase/OResultSet.cxx (working copy)
597 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
600 - SQLSMALLINT nMaxLen = 20;
601 - SQLINTEGER nRealLen = 0;
602 + SQLLEN nMaxLen = 20;
603 + SQLLEN nRealLen = 0;
604 Sequence<sal_Int8> aBookmark(nMaxLen);
606 SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle,
608 sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) );
609 if ( bPositionByBookmark )
611 - SQLINTEGER nRealLen = 0;
612 + SQLLEN nRealLen = 0;
613 nRet = N3SQLBindCol(m_aStatementHandle,
616 Index: connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx
617 ===================================================================
618 --- connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx (revision 274960)
619 +++ connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx (working copy)
623 // -------------------------------------------------------------------------
624 -SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
625 +SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
626 ,SQLHANDLE _aStatementHandle
627 ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
629 ,sal_Int32 _ident) throw(SQLException, RuntimeException)
633 OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle,
634 (SQLUSMALLINT)_column,
635 (SQLUSMALLINT)_ident,
636 @@ -117,13 +117,13 @@
637 return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE);
639 // -------------------------------------------------------------------------
640 -SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
641 +SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
642 ,SQLHANDLE _aStatementHandle
643 ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface
645 throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
648 + SQLSMALLINT nType = 0;
651 nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE);
652 Index: unixODBC/inc/sql.h
653 ===================================================================
654 --- unixODBC/inc/sql.h (revision 274960)
655 +++ unixODBC/inc/sql.h (working copy)
661 /****************************
662 * default to 3.51 declare something else before here and you get a whole new ball of wax
663 ***************************/
665 #define ODBCVER 0x0351
668 +#ifndef __SQLTYPES_H
669 #include "sqltypes.h"
675 #define SQL_NULL_HSTMT 0
676 #if (ODBCVER >= 0x0300)
677 #define SQL_NULL_HDESC 0
678 +#define SQL_NULL_DESC 0
681 /* null handle used in place of parent handle when allocating HENV */
682 @@ -562,254 +566,257 @@
683 #define SQL_NC_HIGH 0
686 -SQLRETURN SQLAllocConnect(SQLHENV EnvironmentHandle,
687 - SQLHDBC *ConnectionHandle);
688 + SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle,
689 + SQLHDBC *ConnectionHandle);
691 -SQLRETURN SQLAllocEnv(SQLHENV *EnvironmentHandle);
692 + SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle);
694 #if (ODBCVER >= 0x0300)
695 -SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType,
696 - SQLHANDLE InputHandle, SQLHANDLE *OutputHandle);
697 + SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType,
698 + SQLHANDLE InputHandle, SQLHANDLE *OutputHandle);
701 -SQLRETURN SQLAllocStmt(SQLHDBC ConnectionHandle,
702 - SQLHSTMT *StatementHandle);
703 + SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle,
704 + SQLHSTMT *StatementHandle);
706 -SQLRETURN SQLBindCol(SQLHSTMT StatementHandle,
707 - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
708 - SQLPOINTER TargetValue, SQLINTEGER BufferLength,
709 - SQLINTEGER *StrLen_or_Ind);
710 + SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle,
711 + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
712 + SQLPOINTER TargetValue, SQLLEN BufferLength,
713 + SQLLEN *StrLen_or_Ind);
715 #if (ODBCVER >= 0x0300)
716 -SQLRETURN SQLBindParam(SQLHSTMT StatementHandle,
717 - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
718 - SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
719 - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
720 - SQLINTEGER *StrLen_or_Ind);
721 + SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle,
722 + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
723 + SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
724 + SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
725 + SQLLEN *StrLen_or_Ind);
728 -SQLRETURN SQLCancel(SQLHSTMT StatementHandle);
729 + SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle);
731 #if (ODBCVER >= 0x0300)
732 -SQLRETURN SQLCloseCursor(SQLHSTMT StatementHandle);
733 + SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);
735 -SQLRETURN SQLColAttribute (SQLHSTMT StatementHandle,
736 - SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
737 - SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
738 - SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute);
739 + SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle,
740 + SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
741 + SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
742 + SQLSMALLINT *StringLength, SQLLEN *NumericAttribute
743 + /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ );
744 + /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */
749 -SQLRETURN SQLColumns(SQLHSTMT StatementHandle,
750 - SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
751 - SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
752 - SQLCHAR *TableName, SQLSMALLINT NameLength3,
753 - SQLCHAR *ColumnName, SQLSMALLINT NameLength4);
754 + SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle,
755 + SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
756 + SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
757 + SQLCHAR *TableName, SQLSMALLINT NameLength3,
758 + SQLCHAR *ColumnName, SQLSMALLINT NameLength4);
761 -SQLRETURN SQLConnect(SQLHDBC ConnectionHandle,
762 - SQLCHAR *ServerName, SQLSMALLINT NameLength1,
763 - SQLCHAR *UserName, SQLSMALLINT NameLength2,
764 - SQLCHAR *Authentication, SQLSMALLINT NameLength3);
765 + SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle,
766 + SQLCHAR *ServerName, SQLSMALLINT NameLength1,
767 + SQLCHAR *UserName, SQLSMALLINT NameLength2,
768 + SQLCHAR *Authentication, SQLSMALLINT NameLength3);
770 #if (ODBCVER >= 0x0300)
771 -SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle,
772 - SQLHDESC TargetDescHandle);
773 + SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle,
774 + SQLHDESC TargetDescHandle);
777 -SQLRETURN SQLDataSources(SQLHENV EnvironmentHandle,
778 - SQLUSMALLINT Direction, SQLCHAR *ServerName,
779 - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
780 - SQLCHAR *Description, SQLSMALLINT BufferLength2,
781 - SQLSMALLINT *NameLength2);
782 + SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle,
783 + SQLUSMALLINT Direction, SQLCHAR *ServerName,
784 + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
785 + SQLCHAR *Description, SQLSMALLINT BufferLength2,
786 + SQLSMALLINT *NameLength2);
788 -SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle,
789 - SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
790 - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
791 - SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
792 - SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable);
793 + SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle,
794 + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
795 + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
796 + SQLSMALLINT *DataType, SQLULEN *ColumnSize,
797 + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable);
799 -SQLRETURN SQLDisconnect(SQLHDBC ConnectionHandle);
800 + SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);
802 #if (ODBCVER >= 0x0300)
803 -SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle,
804 - SQLSMALLINT CompletionType);
805 + SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle,
806 + SQLSMALLINT CompletionType);
809 -SQLRETURN SQLError(SQLHENV EnvironmentHandle,
810 - SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
811 - SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
812 - SQLCHAR *MessageText, SQLSMALLINT BufferLength,
813 - SQLSMALLINT *TextLength);
814 + SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle,
815 + SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
816 + SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
817 + SQLCHAR *MessageText, SQLSMALLINT BufferLength,
818 + SQLSMALLINT *TextLength);
820 -SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle,
821 - SQLCHAR *StatementText, SQLINTEGER TextLength);
822 + SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle,
823 + SQLCHAR *StatementText, SQLINTEGER TextLength);
825 -SQLRETURN SQLExecute(SQLHSTMT StatementHandle);
826 + SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle);
828 -SQLRETURN SQLFetch(SQLHSTMT StatementHandle);
829 + SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle);
831 #if (ODBCVER >= 0x0300)
832 -SQLRETURN SQLFetchScroll(SQLHSTMT StatementHandle,
833 - SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset);
834 + SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle,
835 + SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);
838 -SQLRETURN SQLFreeConnect(SQLHDBC ConnectionHandle);
839 + SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);
841 -SQLRETURN SQLFreeEnv(SQLHENV EnvironmentHandle);
842 + SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle);
844 #if (ODBCVER >= 0x0300)
845 -SQLRETURN SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);
846 + SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);
849 -SQLRETURN SQLFreeStmt(SQLHSTMT StatementHandle,
850 - SQLUSMALLINT Option);
851 + SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle,
852 + SQLUSMALLINT Option);
854 #if (ODBCVER >= 0x0300)
855 -SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle,
856 - SQLINTEGER Attribute, SQLPOINTER Value,
857 - SQLINTEGER BufferLength, SQLINTEGER *StringLength);
858 + SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle,
859 + SQLINTEGER Attribute, SQLPOINTER Value,
860 + SQLINTEGER BufferLength, SQLINTEGER *StringLength);
863 -SQLRETURN SQLGetConnectOption(SQLHDBC ConnectionHandle,
864 - SQLUSMALLINT Option, SQLPOINTER Value);
865 + SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle,
866 + SQLUSMALLINT Option, SQLPOINTER Value);
868 -SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle,
869 - SQLCHAR *CursorName, SQLSMALLINT BufferLength,
870 - SQLSMALLINT *NameLength);
871 + SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle,
872 + SQLCHAR *CursorName, SQLSMALLINT BufferLength,
873 + SQLSMALLINT *NameLength);
875 -SQLRETURN SQLGetData(SQLHSTMT StatementHandle,
876 - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
877 - SQLPOINTER TargetValue, SQLINTEGER BufferLength,
878 - SQLINTEGER *StrLen_or_Ind);
879 + SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle,
880 + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
881 + SQLPOINTER TargetValue, SQLLEN BufferLength,
882 + SQLLEN *StrLen_or_Ind);
884 #if (ODBCVER >= 0x0300)
885 -SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle,
886 - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
887 - SQLPOINTER Value, SQLINTEGER BufferLength,
888 - SQLINTEGER *StringLength);
889 + SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle,
890 + SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
891 + SQLPOINTER Value, SQLINTEGER BufferLength,
892 + SQLINTEGER *StringLength);
894 -SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle,
895 - SQLSMALLINT RecNumber, SQLCHAR *Name,
896 - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
897 - SQLSMALLINT *Type, SQLSMALLINT *SubType,
898 - SQLINTEGER *Length, SQLSMALLINT *Precision,
899 - SQLSMALLINT *Scale, SQLSMALLINT *Nullable);
900 + SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle,
901 + SQLSMALLINT RecNumber, SQLCHAR *Name,
902 + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
903 + SQLSMALLINT *Type, SQLSMALLINT *SubType,
904 + SQLLEN *Length, SQLSMALLINT *Precision,
905 + SQLSMALLINT *Scale, SQLSMALLINT *Nullable);
907 -SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
908 - SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
909 - SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
910 - SQLSMALLINT *StringLength);
911 + SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
912 + SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
913 + SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
914 + SQLSMALLINT *StringLength);
916 -SQLRETURN SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
917 - SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
918 - SQLINTEGER *NativeError, SQLCHAR *MessageText,
919 - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength);
920 + SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
921 + SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
922 + SQLINTEGER *NativeError, SQLCHAR *MessageText,
923 + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength);
925 -SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle,
926 - SQLINTEGER Attribute, SQLPOINTER Value,
927 - SQLINTEGER BufferLength, SQLINTEGER *StringLength);
928 + SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle,
929 + SQLINTEGER Attribute, SQLPOINTER Value,
930 + SQLINTEGER BufferLength, SQLINTEGER *StringLength);
931 #endif /* ODBCVER >= 0x0300 */
933 -SQLRETURN SQLGetFunctions(SQLHDBC ConnectionHandle,
934 - SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported);
935 + SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle,
936 + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported);
938 -SQLRETURN SQLGetInfo(SQLHDBC ConnectionHandle,
939 - SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
940 - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength);
941 + SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle,
942 + SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
943 + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength);
945 #if (ODBCVER >= 0x0300)
946 -SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle,
947 - SQLINTEGER Attribute, SQLPOINTER Value,
948 - SQLINTEGER BufferLength, SQLINTEGER *StringLength);
949 + SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle,
950 + SQLINTEGER Attribute, SQLPOINTER Value,
951 + SQLINTEGER BufferLength, SQLINTEGER *StringLength);
952 #endif /* ODBCVER >= 0x0300 */
954 -SQLRETURN SQLGetStmtOption(SQLHSTMT StatementHandle,
955 - SQLUSMALLINT Option, SQLPOINTER Value);
956 + SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle,
957 + SQLUSMALLINT Option, SQLPOINTER Value);
959 -SQLRETURN SQLGetTypeInfo(SQLHSTMT StatementHandle,
960 - SQLSMALLINT DataType);
961 + SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle,
962 + SQLSMALLINT DataType);
964 -SQLRETURN SQLNumResultCols(SQLHSTMT StatementHandle,
965 - SQLSMALLINT *ColumnCount);
966 + SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle,
967 + SQLSMALLINT *ColumnCount);
969 -SQLRETURN SQLParamData(SQLHSTMT StatementHandle,
970 - SQLPOINTER *Value);
971 + SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle,
972 + SQLPOINTER *Value);
974 -SQLRETURN SQLPrepare(SQLHSTMT StatementHandle,
975 - SQLCHAR *StatementText, SQLINTEGER TextLength);
976 + SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle,
977 + SQLCHAR *StatementText, SQLINTEGER TextLength);
979 -SQLRETURN SQLPutData(SQLHSTMT StatementHandle,
980 - SQLPOINTER Data, SQLINTEGER StrLen_or_Ind);
981 + SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle,
982 + SQLPOINTER Data, SQLLEN StrLen_or_Ind);
984 -SQLRETURN SQLRowCount(SQLHSTMT StatementHandle,
985 - SQLINTEGER *RowCount);
986 + SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle,
989 #if (ODBCVER >= 0x0300)
990 -SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle,
991 - SQLINTEGER Attribute, SQLPOINTER Value,
992 - SQLINTEGER StringLength);
993 + SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle,
994 + SQLINTEGER Attribute, SQLPOINTER Value,
995 + SQLINTEGER StringLength);
996 #endif /* ODBCVER >= 0x0300 */
998 -SQLRETURN SQLSetConnectOption(SQLHDBC ConnectionHandle,
999 - SQLUSMALLINT Option, SQLUINTEGER Value);
1000 + SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle,
1001 + SQLUSMALLINT Option, SQLULEN Value);
1003 -SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle,
1004 - SQLCHAR *CursorName, SQLSMALLINT NameLength);
1005 + SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle,
1006 + SQLCHAR *CursorName, SQLSMALLINT NameLength);
1008 #if (ODBCVER >= 0x0300)
1009 -SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle,
1010 - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
1011 - SQLPOINTER Value, SQLINTEGER BufferLength);
1012 + SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle,
1013 + SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
1014 + SQLPOINTER Value, SQLINTEGER BufferLength);
1016 -SQLRETURN SQLSetDescRec(SQLHDESC DescriptorHandle,
1017 - SQLSMALLINT RecNumber, SQLSMALLINT Type,
1018 - SQLSMALLINT SubType, SQLINTEGER Length,
1019 - SQLSMALLINT Precision, SQLSMALLINT Scale,
1020 - SQLPOINTER Data, SQLINTEGER *StringLength,
1021 - SQLINTEGER *Indicator);
1022 + SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle,
1023 + SQLSMALLINT RecNumber, SQLSMALLINT Type,
1024 + SQLSMALLINT SubType, SQLLEN Length,
1025 + SQLSMALLINT Precision, SQLSMALLINT Scale,
1026 + SQLPOINTER Data, SQLLEN *StringLength,
1027 + SQLLEN *Indicator);
1029 -SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle,
1030 - SQLINTEGER Attribute, SQLPOINTER Value,
1031 - SQLINTEGER StringLength);
1032 + SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle,
1033 + SQLINTEGER Attribute, SQLPOINTER Value,
1034 + SQLINTEGER StringLength);
1035 #endif /* ODBCVER >= 0x0300 */
1037 -SQLRETURN SQLSetParam(SQLHSTMT StatementHandle,
1038 - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
1039 - SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
1040 - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
1041 - SQLINTEGER *StrLen_or_Ind);
1042 + SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle,
1043 + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
1044 + SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
1045 + SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
1046 + SQLLEN *StrLen_or_Ind);
1048 #if (ODBCVER >= 0x0300)
1049 -SQLRETURN SQLSetStmtAttr(SQLHSTMT StatementHandle,
1050 - SQLINTEGER Attribute, SQLPOINTER Value,
1051 - SQLINTEGER StringLength);
1052 + SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle,
1053 + SQLINTEGER Attribute, SQLPOINTER Value,
1054 + SQLINTEGER StringLength);
1057 -SQLRETURN SQLSetStmtOption(SQLHSTMT StatementHandle,
1058 - SQLUSMALLINT Option, SQLUINTEGER Value);
1059 + SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle,
1060 + SQLUSMALLINT Option, SQLULEN Value);
1062 -SQLRETURN SQLSpecialColumns(SQLHSTMT StatementHandle,
1063 - SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
1064 - SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
1065 - SQLSMALLINT NameLength2, SQLCHAR *TableName,
1066 - SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
1067 - SQLUSMALLINT Nullable);
1068 + SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle,
1069 + SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
1070 + SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
1071 + SQLSMALLINT NameLength2, SQLCHAR *TableName,
1072 + SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
1073 + SQLUSMALLINT Nullable);
1075 -SQLRETURN SQLStatistics(SQLHSTMT StatementHandle,
1076 - SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
1077 - SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
1078 - SQLCHAR *TableName, SQLSMALLINT NameLength3,
1079 - SQLUSMALLINT Unique, SQLUSMALLINT Reserved);
1080 + SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle,
1081 + SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
1082 + SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
1083 + SQLCHAR *TableName, SQLSMALLINT NameLength3,
1084 + SQLUSMALLINT Unique, SQLUSMALLINT Reserved);
1086 -SQLRETURN SQLTables(SQLHSTMT StatementHandle,
1087 - SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
1088 - SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
1089 - SQLCHAR *TableName, SQLSMALLINT NameLength3,
1090 - SQLCHAR *TableType, SQLSMALLINT NameLength4);
1091 + SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle,
1092 + SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
1093 + SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
1094 + SQLCHAR *TableName, SQLSMALLINT NameLength3,
1095 + SQLCHAR *TableType, SQLSMALLINT NameLength4);
1097 -SQLRETURN SQLTransact(SQLHENV EnvironmentHandle,
1098 - SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);
1099 + SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle,
1100 + SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);
1104 Index: unixODBC/inc/sqlext.h
1105 ===================================================================
1106 --- unixODBC/inc/sqlext.h (revision 274960)
1107 +++ unixODBC/inc/sqlext.h (working copy)
1110 /* END - unixODBC ONLY */
1117 extern "C" { /* Assume C declarations for C++ */
1120 /* generally useful constants */
1121 #define SQL_SPEC_MAJOR 3 /* Major version of specification */
1122 -#define SQL_SPEC_MINOR 51 /* Minor version of specification */
1123 -#define SQL_SPEC_STRING "03.51" /* String constant for version */
1124 +#define SQL_SPEC_MINOR 52 /* Minor version of specification */
1125 +#define SQL_SPEC_STRING "03.52" /* String constant for version */
1127 #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */
1128 #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */
1130 #define SQL_ATTR_ODBC_VERSION 200
1131 #define SQL_ATTR_CONNECTION_POOLING 201
1132 #define SQL_ATTR_CP_MATCH 202
1134 +/* unixODBC additions */
1135 +#define SQL_ATTR_UNIXODBC_SYSPATH 65001
1136 +#define SQL_ATTR_UNIXODBC_VERSION 65002
1137 +#define SQL_ATTR_UNIXODBC_ENVATTR 65003
1138 #endif /* ODBCVER >= 0x0300 */
1140 #if (ODBCVER >= 0x0300)
1143 #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */
1145 +#define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */
1147 #if (ODBCVER >= 0x0351)
1148 /* ODBC Driver Manager sets this connection attribute to a unicode driver
1149 (which supports SQLConnectW) when the application is an ANSI application
1151 #define SQL_OPT_TRACE_OFF 0UL
1152 #define SQL_OPT_TRACE_ON 1UL
1153 #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
1154 -#define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG"
1155 +#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG"
1157 /* SQL_ODBC_CURSORS options */
1158 #define SQL_CUR_USE_IF_NEEDED 0UL
1159 @@ -516,7 +525,12 @@
1160 #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/
1161 #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
1162 #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
1164 +#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE)
1165 +#define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */
1167 #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
1170 #if (ODBCVER >= 0x0350)
1171 #define SQL_C_GUID SQL_GUID
1173 #define SQL_CONVERT_VARBINARY 69
1174 #define SQL_CONVERT_VARCHAR 70
1175 #define SQL_CONVERT_LONGVARBINARY 71
1176 +#define SQL_CONVERT_GUID 173
1177 #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */
1178 #define SQL_CORRELATION_NAME 74
1179 #define SQL_NON_NULLABLE_COLUMNS 75
1181 #define SQL_QUALIFIER_LOCATION 114
1183 #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300)
1184 +#ifndef SQL_OJ_CAPABILITIES
1185 #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */
1187 #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */
1189 /*----------------------------------------------*/
1191 #define SQL_CVT_WCHAR 0x00200000L
1192 #define SQL_CVT_WLONGVARCHAR 0x00400000L
1193 #define SQL_CVT_WVARCHAR 0x00800000L
1194 +#define SQL_CVT_GUID 0x01000000L
1196 #endif /* ODBCVER >= 0x0300 */
1198 @@ -1199,7 +1217,7 @@
1199 #define SQL_FILE_NOT_SUPPORTED 0x0000
1200 #define SQL_FILE_TABLE 0x0001
1201 #define SQL_FILE_QUALIFIER 0x0002
1202 -#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0
1203 +#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */
1206 /* SQL_GETDATA_EXTENSIONS values */
1207 @@ -1688,7 +1706,7 @@
1208 #define SQL_DRIVER_PROMPT 2
1209 #define SQL_DRIVER_COMPLETE_REQUIRED 3
1211 -SQLRETURN SQLDriverConnect(
1212 +SQLRETURN SQL_API SQLDriverConnect(
1215 SQLCHAR *szConnStrIn,
1216 @@ -1762,8 +1780,7 @@
1217 #define SQL_PT_FUNCTION 2
1219 /* This define is too large for RC */
1220 -#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"
1222 +#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
1223 "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
1224 "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
1225 "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
1226 @@ -1794,9 +1811,8 @@
1227 "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
1228 "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\
1232 -SQLRETURN SQLBrowseConnect(
1233 +SQLRETURN SQL_API SQLBrowseConnect(
1235 SQLCHAR *szConnStrIn,
1236 SQLSMALLINT cbConnStrIn,
1237 @@ -1805,21 +1821,21 @@
1238 SQLSMALLINT *pcbConnStrOut);
1240 #if (ODBCVER >= 0x0300)
1241 -SQLRETURN SQLBulkOperations(
1242 +SQLRETURN SQL_API SQLBulkOperations(
1243 SQLHSTMT StatementHandle,
1244 SQLSMALLINT Operation);
1245 #endif /* ODBCVER >= 0x0300 */
1247 -SQLRETURN SQLColAttributes(
1248 +SQLRETURN SQL_API SQLColAttributes(
1251 SQLUSMALLINT fDescType,
1253 SQLSMALLINT cbDescMax,
1254 SQLSMALLINT *pcbDesc,
1255 - SQLINTEGER *pfDesc);
1258 -SQLRETURN SQLColumnPrivileges(
1259 +SQLRETURN SQL_API SQLColumnPrivileges(
1261 SQLCHAR *szCatalogName,
1262 SQLSMALLINT cbCatalogName,
1263 @@ -1830,22 +1846,22 @@
1264 SQLCHAR *szColumnName,
1265 SQLSMALLINT cbColumnName);
1267 -SQLRETURN SQLDescribeParam(
1268 +SQLRETURN SQL_API SQLDescribeParam(
1271 SQLSMALLINT *pfSqlType,
1272 - SQLUINTEGER *pcbParamDef,
1273 + SQLULEN *pcbParamDef,
1274 SQLSMALLINT *pibScale,
1275 SQLSMALLINT *pfNullable);
1277 -SQLRETURN SQLExtendedFetch(
1278 +SQLRETURN SQL_API SQLExtendedFetch(
1280 SQLUSMALLINT fFetchType,
1282 - SQLUINTEGER *pcrow,
1283 - SQLUSMALLINT *rgfRowStatus);
1286 + SQLUSMALLINT *rgfRowStatus);
1288 -SQLRETURN SQLForeignKeys(
1289 +SQLRETURN SQL_API SQLForeignKeys(
1291 SQLCHAR *szPkCatalogName,
1292 SQLSMALLINT cbPkCatalogName,
1293 @@ -1860,10 +1876,10 @@
1294 SQLCHAR *szFkTableName,
1295 SQLSMALLINT cbFkTableName);
1297 -SQLRETURN SQLMoreResults(
1298 +SQLRETURN SQL_API SQLMoreResults(
1301 -SQLRETURN SQLNativeSql(
1302 +SQLRETURN SQL_API SQLNativeSql(
1304 SQLCHAR *szSqlStrIn,
1305 SQLINTEGER cbSqlStrIn,
1306 @@ -1871,16 +1887,16 @@
1307 SQLINTEGER cbSqlStrMax,
1308 SQLINTEGER *pcbSqlStr);
1310 -SQLRETURN SQLNumParams(
1311 +SQLRETURN SQL_API SQLNumParams(
1313 SQLSMALLINT *pcpar);
1315 -SQLRETURN SQLParamOptions(
1316 +SQLRETURN SQL_API SQLParamOptions(
1319 - SQLUINTEGER *pirow);
1323 -SQLRETURN SQLPrimaryKeys(
1324 +SQLRETURN SQL_API SQLPrimaryKeys(
1326 SQLCHAR *szCatalogName,
1327 SQLSMALLINT cbCatalogName,
1328 @@ -1889,7 +1905,7 @@
1329 SQLCHAR *szTableName,
1330 SQLSMALLINT cbTableName);
1332 -SQLRETURN SQLProcedureColumns(
1333 +SQLRETURN SQL_API SQLProcedureColumns(
1335 SQLCHAR *szCatalogName,
1336 SQLSMALLINT cbCatalogName,
1337 @@ -1900,7 +1916,7 @@
1338 SQLCHAR *szColumnName,
1339 SQLSMALLINT cbColumnName);
1341 -SQLRETURN SQLProcedures(
1342 +SQLRETURN SQL_API SQLProcedures(
1344 SQLCHAR *szCatalogName,
1345 SQLSMALLINT cbCatalogName,
1346 @@ -1909,13 +1925,13 @@
1347 SQLCHAR *szProcName,
1348 SQLSMALLINT cbProcName);
1350 -SQLRETURN SQLSetPos(
1351 +SQLRETURN SQL_API SQLSetPos(
1353 - SQLUSMALLINT irow,
1354 + SQLSETPOSIROW irow,
1355 SQLUSMALLINT fOption,
1356 SQLUSMALLINT fLock);
1358 -SQLRETURN SQLTablePrivileges(
1359 +SQLRETURN SQL_API SQLTablePrivileges(
1361 SQLCHAR *szCatalogName,
1362 SQLSMALLINT cbCatalogName,
1363 @@ -1924,7 +1940,7 @@
1364 SQLCHAR *szTableName,
1365 SQLSMALLINT cbTableName);
1367 -SQLRETURN SQLDrivers(
1368 +SQLRETURN SQL_API SQLDrivers(
1370 SQLUSMALLINT fDirection,
1371 SQLCHAR *szDriverDesc,
1372 @@ -1934,17 +1950,17 @@
1373 SQLSMALLINT cbDrvrAttrMax,
1374 SQLSMALLINT *pcbDrvrAttr);
1376 -SQLRETURN SQLBindParameter(
1377 +SQLRETURN SQL_API SQLBindParameter(
1380 SQLSMALLINT fParamType,
1382 SQLSMALLINT fSqlType,
1383 - SQLUINTEGER cbColDef,
1385 SQLSMALLINT ibScale,
1386 SQLPOINTER rgbValue,
1387 - SQLINTEGER cbValueMax,
1388 - SQLINTEGER *pcbValue);
1389 + SQLLEN cbValueMax,
1390 + SQLLEN *pcbValue);
1392 /*---------------------------------------------------------*/
1393 /* SQLAllocHandleStd is implemented to make SQLAllocHandle */
1394 @@ -1972,7 +1988,7 @@
1395 #endif /* ODBC_STD */
1397 #if (ODBCVER >= 0x0300)
1398 -SQLRETURN SQLAllocHandleStd(
1399 +SQLRETURN SQL_API SQLAllocHandleStd(
1400 SQLSMALLINT fHandleType,
1402 SQLHANDLE *phOutput);
1403 @@ -1999,21 +2015,57 @@
1404 #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */
1406 /* Deprecated functions from prior versions of ODBC */
1407 -SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */
1408 +SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */
1410 SQLUSMALLINT fConcurrency,
1411 - SQLINTEGER crowKeyset,
1412 + SQLLEN crowKeyset,
1413 SQLUSMALLINT crowRowset);
1415 -/* Tracing section */
1417 + * \defgroup Tracing.
1419 + * unixODBC implements a slight variation of the tracing mechanism used
1420 + * on MS platforms. The unixODBC method loses the ability to produce trace
1421 + * output for invalid handles but gains the following;
1423 + * - better concurrency
1424 + * - allows tracing to be turned on/off and configured at finer granularity
1425 + * - hopefully; better performance
1427 + * unixODBC provides a cross-platform helper library called 'trace' and an
1428 + * example/default trace plugin called 'odbctrac'. Those writing an ODBC
1429 + * driver can use the 'trace' helper library (a static library). Those wanting
1430 + * to create custom trace output can implement a different version of the
1431 + * 'odbctrac' plugin.
1433 + * The text file driver (odbctxt) included with unixODBC is an example of a
1434 + * driver using the 'trace' helper library.
1436 + * The 'trace' library and the example plugin 'odbctrac' are designed to be
1437 + * portable on all platforms where unixODBC is available and on MS platforms.
1438 + * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly
1439 + * portable. On MS platforms - this compliments traditional tracing (mostly
1440 + * just used by the Driver Manager).
1447 +#define TRACE_VERSION 1000 /*!< Version of trace API */
1449 +RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */
1451 +RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */
1453 +RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */
1454 +SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */
1456 +DWORD TraceVersion(); /*!< Returns trace API version */
1458 +DWORD TraceVersion(VOID); /*!< Returns trace API version */
1461 -#define TRACE_VERSION 1000 /* Version of trace API */
1463 -RETCODE TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); /* open a trace log file */
1464 -RETCODE TraceCloseLogFile(); /* Request to close a trace log */
1465 -VOID TraceReturn(RETCODE,RETCODE); /* Processes trace after FN is called */
1466 -DWORD TraceVersion(); /* Returns trace API version */
1468 /* Functions for Visual Studio Analyzer*/
1469 /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */
1470 #define TRACE_ON 0x00000001L
1471 @@ -2028,7 +2080,11 @@
1472 #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */
1474 typedef struct tagODBC_VS_ARGS {
1475 +#ifdef GUID_DEFINED
1476 const GUID *pguidEvent; /* the GUID for event */
1478 + const void *pguidEvent; /* the GUID for event */
1480 DWORD dwFlags; /* flags for the call */
1483 @@ -2042,10 +2098,25 @@
1484 } ODBC_VS_ARGS, *PODBC_VS_ARGS;
1486 VOID FireVSDebugEvent(PODBC_VS_ARGS);
1495 + * connection pooling retry times
1498 +BOOL ODBCSetTryWaitValue ( DWORD dwValue );
1500 +DWORD ODBCGetTryWaitValue ( );
1502 +DWORD ODBCGetTryWaitValue ( VOID );
1505 +#ifndef __SQLUCODE_H
1506 +#include "sqlucode.h"
1510 Index: unixODBC/inc/sqltypes.h
1511 ===================================================================
1512 --- unixODBC/inc/sqltypes.h (revision 274960)
1513 +++ unixODBC/inc/sqltypes.h (working copy)
1514 @@ -26,48 +26,111 @@
1515 #define ODBCVER 0x0351
1519 + * if thi sis set, then use a 4 byte unicode definition, insteead of the 2 bye that MS use
1522 +#ifdef SQL_WCHART_CONVERT
1524 + * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t
1525 + * Microsoft hardcoded a definition of unsigned short which may not be compatible with
1526 + * your platform specific wide char definition.
1531 +#include <sal/types.h>
1537 -#ifndef SIZEOF_LONG
1538 -# if defined(__alpha__) || defined(__x86_64__) || defined(__ia64__) || defined(__s390x__) || defined(__sparcv9) || defined(__LP64__)
1539 -# define SIZEOF_LONG 8
1541 -# define SIZEOF_LONG 4
1542 +#ifndef SIZEOF_LONG_INT
1543 +# define SIZEOF_LONG_INT SAL_TYPES_SIZEOFLONG
1546 +# define ODBCINT64 sal_Int64
1549 +# define UODBCINT64 sal_uInt64
1553 + * this is defined by configure, but will not be on a normal application build
1554 + * the install creates a unixodbc_conf.h file that contains the current build settings
1557 +#ifndef SIZEOF_LONG_INT
1558 +#include <unixodbc_conf.h>
1561 +#ifndef SIZEOF_LONG_INT
1562 +#error "Needs to know how big a long int is to continue!!!"
1565 /****************************
1566 * These make up for having no windows.h
1567 ***************************/
1568 +#ifndef ALLREADY_HAVE_WINDOWS_TYPE
1573 +#define SQL_API _System
1580 -typedef char* GUID;
1585 + * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and
1586 + * be able to compile for both unicode and non-unicode with the same source.
1587 + * This is not recommanded for linux applications and is not supported
1588 + * by the standard linux string header files.
1590 +#ifdef SQL_WCHART_CONVERT
1591 +typedef wchar_t TCHAR;
1593 +typedef signed short TCHAR;
1595 -#define GUID_DEFINED
1599 +typedef char TCHAR;
1602 #ifndef DONT_TD_VOID
1606 typedef unsigned short WORD;
1607 -#if SIZEOF_LONG == 4
1608 - typedef unsigned long DWORD;
1609 +#if (SIZEOF_LONG_INT == 4)
1610 +typedef unsigned long DWORD;
1612 - typedef unsigned int DWORD;
1613 +typedef unsigned int DWORD;
1615 typedef unsigned char BYTE;
1617 +#ifdef SQL_WCHART_CONVERT
1618 +typedef wchar_t WCHAR;
1620 typedef unsigned short WCHAR;
1621 -typedef WCHAR* LPWSTR;
1624 +typedef WCHAR* LPWSTR;
1625 typedef const char* LPCSTR;
1626 +typedef const WCHAR* LPCWSTR;
1627 +typedef TCHAR* LPTSTR;
1628 typedef char* LPSTR;
1629 typedef DWORD* LPDWORD;
1631 +typedef void* HINSTANCE;
1636 /****************************
1637 * standard SQL* data types. use these as much as possible when using ODBC calls/vars
1638 ***************************/
1639 @@ -80,11 +143,61 @@
1640 typedef double SQLFLOAT;
1643 -#if SIZEOF_LONG == 4
1644 - typedef long SQLINTEGER;
1646 + * can't use a long it fails on 64 platforms
1650 + * Hopefully by now it should be safe to assume most drivers know about SQLLEN now
1651 + * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms
1655 +#if (SIZEOF_LONG_INT == 8)
1656 +#ifdef BUILD_LEGACY_64_BIT_MODE
1657 +typedef int SQLINTEGER;
1658 +typedef unsigned int SQLUINTEGER;
1659 +#define SQLLEN SQLINTEGER
1660 +#define SQLULEN SQLUINTEGER
1661 +#define SQLSETPOSIROW SQLUSMALLINT
1663 + * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril
1665 + typedef SQLULEN SQLROWCOUNT;
1666 + typedef SQLULEN SQLROWSETSIZE;
1667 + typedef SQLULEN SQLTRANSID;
1668 + typedef SQLLEN SQLROWOFFSET;
1671 - typedef int SQLINTEGER;
1672 +typedef int SQLINTEGER;
1673 +typedef unsigned int SQLUINTEGER;
1674 +typedef long SQLLEN;
1675 +typedef unsigned long SQLULEN;
1676 +typedef unsigned long SQLSETPOSIROW;
1678 + * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril
1680 + typedef SQLULEN SQLTRANSID;
1681 + typedef SQLULEN SQLROWCOUNT;
1682 + typedef SQLUINTEGER SQLROWSETSIZE;
1683 + typedef SQLLEN SQLROWOFFSET;
1685 +typedef SQLULEN SQLROWCOUNT;
1686 +typedef SQLULEN SQLROWSETSIZE;
1687 +typedef SQLULEN SQLTRANSID;
1688 +typedef SQLLEN SQLROWOFFSET;
1691 +typedef long SQLINTEGER;
1692 +typedef unsigned long SQLUINTEGER;
1693 +#define SQLLEN SQLINTEGER
1694 +#define SQLULEN SQLUINTEGER
1695 +#define SQLSETPOSIROW SQLUSMALLINT
1696 +typedef SQLULEN SQLROWCOUNT;
1697 +typedef SQLULEN SQLROWSETSIZE;
1698 +typedef SQLULEN SQLTRANSID;
1699 +typedef SQLLEN SQLROWOFFSET;
1702 #if (ODBCVER >= 0x0300)
1703 typedef unsigned char SQLNUMERIC;
1704 @@ -107,39 +220,58 @@
1706 typedef SQLSMALLINT SQLRETURN;
1708 -/* typedef void * SQLHANDLE; */
1710 -typedef SQLINTEGER SQLHANDLE;
1711 #if (ODBCVER >= 0x0300)
1713 +typedef void * SQLHANDLE;
1714 typedef SQLHANDLE SQLHENV;
1715 typedef SQLHANDLE SQLHDBC;
1716 typedef SQLHANDLE SQLHSTMT;
1717 typedef SQLHANDLE SQLHDESC;
1719 +typedef void * SQLHENV;
1720 +typedef void * SQLHDBC;
1721 +typedef void * SQLHSTMT;
1723 + * some things like PHP won't build without this
1725 +typedef void * SQLHANDLE;
1728 +/****************************
1729 + * These are cast into the actual struct that is being passed around. The
1730 + * DriverManager knows what its structs look like and the Driver knows about its
1731 + * structs... the app knows nothing about them... just void*
1732 + * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT
1733 + ***************************/
1735 +#if (ODBCVER >= 0x0300)
1736 +typedef SQLHANDLE HENV;
1737 +typedef SQLHANDLE HDBC;
1738 +typedef SQLHANDLE HSTMT;
1740 -typedef SQLINTEGER SQLHENV;
1741 -typedef SQLINTEGER SQLHDBC;
1742 -typedef SQLINTEGER SQLHSTMT;
1743 +typedef void * HENV;
1744 +typedef void * HDBC;
1745 +typedef void * HSTMT;
1749 /****************************
1750 * more basic data types to augment what windows.h provides
1751 ***************************/
1752 +#ifndef ALLREADY_HAVE_WINDOWS_TYPE
1754 typedef unsigned char UCHAR;
1755 typedef signed char SCHAR;
1756 typedef SCHAR SQLSCHAR;
1757 -#if SIZEOF_LONG == 4
1758 - typedef long int SDWORD;
1759 - typedef unsigned long int UDWORD;
1760 +#if (SIZEOF_LONG_INT == 4)
1761 +typedef long int SDWORD;
1762 +typedef unsigned long int UDWORD;
1764 - typedef signed int SDWORD;
1765 - typedef unsigned int UDWORD;
1766 +typedef int SDWORD;
1767 +typedef unsigned int UDWORD;
1769 typedef signed short int SWORD;
1770 typedef unsigned short int UWORD;
1771 -typedef UDWORD SQLUINTEGER;
1772 +typedef unsigned int UINT;
1773 typedef signed long SLONG;
1774 typedef signed short SSHORT;
1775 typedef unsigned long ULONG;
1776 @@ -151,20 +283,7 @@
1777 typedef signed short RETCODE;
1778 typedef void* SQLHWND;
1780 -/****************************
1781 - * These are cast into the actual struct that is being passed around. The
1782 - * DriverManager knows what its structs look like and the Driver knows about its
1783 - * structs... the app knows nothing about them... just void*
1784 - * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT
1785 - ***************************/
1787 -typedef void* HENV;
1788 -typedef void* HDBC;
1789 -typedef void* HSTMT;
1791 -typedef SQLHANDLE HENV;
1792 -typedef SQLHANDLE HDBC;
1793 -typedef SQLHANDLE HSTMT;
1796 /****************************
1797 * standard structs for working with date/times
1798 @@ -263,12 +382,41 @@
1799 /****************************
1801 ***************************/
1802 -#if (ODBCVER >= 0x0300)
1803 -#define ODBCINT64 long
1805 +# if (ODBCVER >= 0x0300)
1806 +# if (SIZEOF_LONG_INT == 8)
1807 +# define ODBCINT64 long
1808 +# define UODBCINT64 unsigned long
1810 +# ifdef HAVE_LONG_LONG
1811 +# define ODBCINT64 long long
1812 +# define UODBCINT64 unsigned long long
1815 + * may fail in some cases, but what else can we do ?
1817 +struct __bigint_struct
1820 + unsigned int loword;
1822 +struct __bigint_struct_u
1824 + unsigned int hiword;
1825 + unsigned int loword;
1827 +# define ODBCINT64 struct __bigint_struct
1828 +# define UODBCINT64 struct __bigint_struct_u
1835 typedef ODBCINT64 SQLBIGINT;
1836 -typedef unsigned ODBCINT64 SQLUBIGINT;
1839 +typedef UODBCINT64 SQLUBIGINT;
1845 #if (ODBCVER >= 0x0350)
1847 +#ifndef ALLREADY_HAVE_WINDOWS_TYPE
1848 typedef GUID SQLGUID;
1850 typedef struct tagSQLGUID
1851 @@ -298,18 +447,21 @@
1856 +typedef struct tagSQLGUID
1866 +typedef SQLULEN BOOKMARK;
1868 -typedef unsigned long int BOOKMARK;
1869 +typedef WCHAR SQLWCHAR;
1872 -#ifdef _WCHAR_T_DEFINED
1873 -typedef wchar_t SQLWCHAR;
1875 -typedef unsigned short SQLWCHAR;
1879 typedef SQLWCHAR SQLTCHAR;