Update of /cvsroot/htoolkit/HSQL/ODBC
In directory sc8-pr-cvs1:/tmp/cvs-serv6605/ODBC
Modified Files:
HSQL.hsc
Log Message:
Add support for SqlWChar, SqlWVarChar and SqlWLongVarChar
Index: HSQL.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/ODBC/HSQL.hsc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** HSQL.hsc 5 Jan 2004 00:41:03 -0000 1.13
--- HSQL.hsc 5 Jan 2004 09:25:21 -0000 1.14
***************
*** 131,134 ****
--- 131,137 ----
| SqlVarChar Int
| SqlLongVarChar Int
+ | SqlWChar Int
+ | SqlWVarChar Int
+ | SqlWLongVarChar Int
| SqlDecimal Int Int
| SqlNumeric Int Int
***************
*** 338,341 ****
--- 341,348 ----
mkSqlType (#const SQL_TIME) _ _ = (SqlTime, (#const sizeof(SQL_TIME_STRUCT)))
mkSqlType (#const SQL_TIMESTAMP) _ _ = (SqlTimeStamp, (#const sizeof(SQL_TIMESTAMP_STRUCT)))
+ mkSqlType (#const SQL_WCHAR) size _ = (SqlWChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1))
+ mkSqlType (#const SQL_WVARCHAR) size _ = (SqlWVarChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1))
+ mkSqlType (#const SQL_WLONGVARCHAR) size _ = (SqlWLongVarChar (fromIntegral size), (#const sizeof(SQLCHAR))*(fromIntegral size+1))
+
-- | Executes the statement and returns a 'Statement' value which represents the result set
***************
*** 382,385 ****
--- 389,393 ----
describe conn table = do
stmt <- withStatement conn (\hSTMT -> sqlColumns' hSTMT table)
+ print (getFieldsTypes stmt)
collectRows getColumnInfo stmt
where
***************
*** 460,463 ****
--- 468,474 ----
fromSqlValue (SqlVarChar _) ptr size = fmap Just $ peekCStringLen (castPtr ptr, size)
fromSqlValue (SqlLongVarChar _) ptr size = fmap Just $ peekCStringLen (castPtr ptr, size)
+ fromSqlValue (SqlWChar _) ptr size = fmap Just $ peekCStringLen (castPtr ptr, size)
+ fromSqlValue (SqlWVarChar _) ptr size = fmap Just $ peekCStringLen (castPtr ptr, size)
+ fromSqlValue (SqlWLongVarChar _) ptr size = fmap Just $ peekCStringLen (castPtr ptr, size)
fromSqlValue _ _ _ = return Nothing
***************
*** 562,569 ****
SqlBigInt -> (#const SQL_C_CHAR)
SqlChar _ -> (#const SQL_C_CHAR)
! SqlVarChar _ -> (#const SQL_C_CHAR)
SqlBinary _ -> (#const SQL_C_BINARY)
SqlVarBinary _ -> (#const SQL_C_BINARY)
SqlLongVarChar _ -> (#const SQL_C_CHAR)
SqlLongVarBinary _ -> (#const SQL_C_BINARY)
--- 573,583 ----
SqlBigInt -> (#const SQL_C_CHAR)
SqlChar _ -> (#const SQL_C_CHAR)
! SqlVarChar _ -> (#const SQL_C_CHAR)
! SqlWChar _ -> (#const SQL_C_CHAR)
! SqlWVarChar _ -> (#const SQL_C_CHAR)
SqlBinary _ -> (#const SQL_C_BINARY)
SqlVarBinary _ -> (#const SQL_C_BINARY)
SqlLongVarChar _ -> (#const SQL_C_CHAR)
+ SqlWLongVarChar _ -> (#const SQL_C_CHAR)
SqlLongVarBinary _ -> (#const SQL_C_BINARY)
|