date and time types macros

This commit is contained in:
Aleksandar Fabijanic 2008-01-26 16:01:42 +00:00
parent 5f7122d21b
commit fd1d5aed5f
5 changed files with 28 additions and 28 deletions

View File

@ -648,8 +648,8 @@ private:
if (Utility::isError(SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1,
toODBCDirection(dir),
SQL_C_DATE,
SQL_DATE,
SQL_C_TYPE_DATE,
SQL_TYPE_DATE,
colSize,
decDigits,
(SQLPOINTER) &_dateVec[pos][0],
@ -692,8 +692,8 @@ private:
if (Utility::isError(SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1,
toODBCDirection(dir),
SQL_C_TIME,
SQL_TIME,
SQL_C_TYPE_TIME,
SQL_TYPE_TIME,
colSize,
decDigits,
(SQLPOINTER) &_timeVec[pos][0],
@ -736,8 +736,8 @@ private:
if (Utility::isError(SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1,
toODBCDirection(dir),
SQL_C_TIMESTAMP,
SQL_TIMESTAMP,
SQL_C_TYPE_TIMESTAMP,
SQL_TYPE_TIMESTAMP,
colSize,
decDigits,
(SQLPOINTER) &_dateTimeVec[pos][0],

View File

@ -229,8 +229,8 @@ void Binder::bind(std::size_t pos, const Date& val, Direction dir)
if (Utility::isError(SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1,
toODBCDirection(dir),
SQL_C_DATE,
SQL_DATE,
SQL_C_TYPE_DATE,
SQL_TYPE_DATE,
colSize,
decDigits,
(SQLPOINTER) pDS,
@ -262,8 +262,8 @@ void Binder::bind(std::size_t pos, const Time& val, Direction dir)
if (Utility::isError(SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1,
toODBCDirection(dir),
SQL_C_TIME,
SQL_TIME,
SQL_C_TYPE_TIME,
SQL_TYPE_TIME,
colSize,
decDigits,
(SQLPOINTER) pTS,
@ -295,8 +295,8 @@ void Binder::bind(std::size_t pos, const Poco::DateTime& val, Direction dir)
if (Utility::isError(SQLBindParameter(_rStmt,
(SQLUSMALLINT) pos + 1,
toODBCDirection(dir),
SQL_C_TIMESTAMP,
SQL_TIMESTAMP,
SQL_C_TYPE_TIMESTAMP,
SQL_TYPE_TIMESTAMP,
colSize,
decDigits,
(SQLPOINTER) pTS,

View File

@ -771,7 +771,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Data::BLOB>& val)
bool Extractor::extract(std::size_t pos, Poco::Data::Date& val)
{
if (Preparation::DE_MANUAL == _dataExtraction)
return extractManualImpl(pos, val, SQL_C_DATE);
return extractManualImpl(pos, val, SQL_C_TYPE_DATE);
else
return extractBoundImpl(pos, val);
}
@ -807,7 +807,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Data::Date>& val)
bool Extractor::extract(std::size_t pos, Poco::Data::Time& val)
{
if (Preparation::DE_MANUAL == _dataExtraction)
return extractManualImpl(pos, val, SQL_C_TIME);
return extractManualImpl(pos, val, SQL_C_TYPE_TIME);
else
return extractBoundImpl(pos, val);
}
@ -843,7 +843,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Data::Time>& val)
bool Extractor::extract(std::size_t pos, Poco::DateTime& val)
{
if (Preparation::DE_MANUAL == _dataExtraction)
return extractManualImpl(pos, val, SQL_C_TIMESTAMP);
return extractManualImpl(pos, val, SQL_C_TYPE_TIMESTAMP);
else
return extractBoundImpl(pos, val);
}

View File

@ -76,9 +76,9 @@ void TypeInfo::fillCTypes()
_cDataTypes.insert(ValueType(SQL_BINARY, SQL_C_BINARY));
_cDataTypes.insert(ValueType(SQL_VARBINARY, SQL_C_BINARY));
_cDataTypes.insert(ValueType(SQL_LONGVARBINARY, SQL_C_BINARY));
_cDataTypes.insert(ValueType(SQL_TYPE_DATE, SQL_C_DATE));
_cDataTypes.insert(ValueType(SQL_TYPE_TIME, SQL_C_TIME));
_cDataTypes.insert(ValueType(SQL_TYPE_TIMESTAMP, SQL_C_TIMESTAMP));
_cDataTypes.insert(ValueType(SQL_TYPE_DATE, SQL_C_TYPE_DATE));
_cDataTypes.insert(ValueType(SQL_TYPE_TIME, SQL_C_TYPE_TIME));
_cDataTypes.insert(ValueType(SQL_TYPE_TIMESTAMP, SQL_C_TYPE_TIMESTAMP));
}
@ -100,9 +100,9 @@ void TypeInfo::fillSQLTypes()
_sqlDataTypes.insert(ValueType(SQL_C_FLOAT, SQL_REAL));
_sqlDataTypes.insert(ValueType(SQL_C_DOUBLE, SQL_DOUBLE));
_sqlDataTypes.insert(ValueType(SQL_C_BINARY, SQL_LONGVARBINARY));
_sqlDataTypes.insert(ValueType(SQL_C_DATE, SQL_TYPE_DATE));
_sqlDataTypes.insert(ValueType(SQL_C_TIME, SQL_TYPE_TIME));
_sqlDataTypes.insert(ValueType(SQL_C_TIMESTAMP, SQL_TYPE_TIMESTAMP));
_sqlDataTypes.insert(ValueType(SQL_C_TYPE_DATE, SQL_TYPE_DATE));
_sqlDataTypes.insert(ValueType(SQL_C_TYPE_TIME, SQL_TYPE_TIME));
_sqlDataTypes.insert(ValueType(SQL_C_TYPE_TIMESTAMP, SQL_TYPE_TIMESTAMP));
}

View File

@ -249,7 +249,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString,
rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
poco_odbc_check_stmt (rc, hstmt);
rc = SQLGetTypeInfo(hstmt, SQL_TIMESTAMP);
rc = SQLGetTypeInfo(hstmt, SQL_TYPE_TIMESTAMP);
poco_odbc_check_stmt (rc, hstmt);
rc = SQLFetch(hstmt);
@ -268,7 +268,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString,
assert (sizeof(SQL_TIMESTAMP_STRUCT) <= dateTimeColSize);
}
else if (SQL_NO_DATA == rc)
std::cerr << '[' << name() << ']' << " Warning: no SQL_TIMESTAMP data type info returned by driver." << std::endl;
std::cerr << '[' << name() << ']' << " Warning: no SQL_TYPE_TIMESTAMP data type info returned by driver." << std::endl;
rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
poco_odbc_check_stmt (rc, hstmt);
@ -399,13 +399,13 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString,
dateTimeDecDigits = decimalDigits;
}
else
std::cerr << '[' << name() << ']' << " Warning: could not get SQL_TIMESTAMP parameter description." << std::endl;
std::cerr << '[' << name() << ']' << " Warning: could not get SQL_TYPE_TIMESTAMP parameter description." << std::endl;
rc = SQLBindParameter(hstmt,
(SQLUSMALLINT) 6,
SQL_PARAM_INPUT,
SQL_C_TIMESTAMP,
SQL_TIMESTAMP,
SQL_C_TYPE_TIMESTAMP,
SQL_TYPE_TIMESTAMP,
dateTimeColSize,
dateTimeDecDigits,
(SQLPOINTER) &sixth,
@ -502,7 +502,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString,
rc = SQLBindCol(hstmt,
(SQLUSMALLINT) 6,
SQL_C_TIMESTAMP,
SQL_C_TYPE_TIMESTAMP,
(SQLPOINTER) &sixth,
(SQLINTEGER) 0,
&lengths[5]);
@ -576,7 +576,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString,
rc = SQLGetData(hstmt,
(SQLUSMALLINT) 6,
SQL_C_TIMESTAMP,
SQL_C_TYPE_TIMESTAMP,
&sixth,
0,
&lengths[5]);