Date: Monday, January 2, 2006 @ 11:40:42
Author: gilles
Path: /cvsroot/carob/carob/src
Modified: DriverResultSet.cpp (1.29 -> 1.30)
Added support of date, time and timestamp in getAsString and getAsInt
---------------------+
DriverResultSet.cpp | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
Index: carob/src/DriverResultSet.cpp
diff -u carob/src/DriverResultSet.cpp:1.29 carob/src/DriverResultSet.cpp:1.30
--- carob/src/DriverResultSet.cpp:1.29 Fri Dec 30 11:38:24 2005
+++ carob/src/DriverResultSet.cpp Mon Jan 2 11:40:42 2006
@@ -254,13 +254,14 @@
throw NotImplementedException(L"ByteArray to string conversion not
implemented yet.");
break;
case TT_SQL_DATE:
- throw NotImplementedException(L"SQL Date to string conversion not
implemented yet.");
+ buffer << ((data[currentRow])[columnIndex - 1]).as_long;
break;
case TT_SQL_TIME:
- throw NotImplementedException(L"SQL Time to string conversion not
implemented yet.");
+ buffer << ((data[currentRow])[columnIndex - 1]).as_int;
break;
case TT_SQL_TIMESTAMP:
- throw NotImplementedException(L"SQL TimeStamp to string conversion not
implemented yet.");
+ // Gets only the time, forget the nanos
+ buffer << ((data[currentRow])[columnIndex - 1]).as_long;
break;
case TT_BLOB:
throw NotImplementedException(L"Blob to string conversion not
implemented yet.");
@@ -354,13 +355,14 @@
throw NotImplementedException(L"ByteArray to int conversion not
implemented yet.");
break;
case TT_SQL_DATE:
- throw NotImplementedException(L"SQL Date to int conversion not
implemented yet.");
+ ret = (int)(((data[currentRow])[columnIndex - 1]).as_long);
break;
case TT_SQL_TIME:
- throw NotImplementedException(L"SQL Time to int conversion not
implemented yet.");
+ ret = ((data[currentRow])[columnIndex - 1]).as_int;
break;
case TT_SQL_TIMESTAMP:
- throw NotImplementedException(L"SQL TimeStamp to int conversion not
implemented yet.");
+ // Gets only the time, forget the nanos
+ ret = (int)(((data[currentRow])[columnIndex - 1]).as_long);
break;
case TT_BLOB:
throw NotImplementedException(L"Blob to int conversion not implemented
yet.");
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits