diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-21 11:19:24 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-21 11:19:24 +0200 |
commit | 28b329b63a3919020a9286b557f7938dc8fbd746 (patch) | |
tree | 45ff48d166a6dd4f02f710fe96d34fd10b4003e9 /odb/mssql/mssql-fwd.hxx | |
parent | 213740c161499a5961fa426d1b77c7d68763c5df (diff) |
ODB compiler implementation, traits, and types test for SQL Server
Diffstat (limited to 'odb/mssql/mssql-fwd.hxx')
-rw-r--r-- | odb/mssql/mssql-fwd.hxx | 72 |
1 files changed, 66 insertions, 6 deletions
diff --git a/odb/mssql/mssql-fwd.hxx b/odb/mssql/mssql-fwd.hxx index 20acab3..fbb57f7 100644 --- a/odb/mssql/mssql-fwd.hxx +++ b/odb/mssql/mssql-fwd.hxx @@ -93,6 +93,12 @@ typedef SQLHANDLE SQLHDESC; # define SQL_HANDLE_DESC 4 #endif +#ifndef SQL_NULL_DATA +# define SQL_NULL_DATA (-1) +# define SQL_DATA_AT_EXEC (-2) +# define SQL_NO_TOTAL (-4) +#endif + // The following types are our own equivalents of ODBC and Native Client // ODBC driver types. They are all PODs and should be layout-compatible // with the original types, which means they can be used interchangeably. @@ -122,7 +128,7 @@ namespace odb struct decimal { unsigned char precision; - signed char scale; + signed char scale; unsigned char sign; // 1 - positive, 0 - negative unsigned char val[SQL_MAX_NUMERIC_LEN]; }; @@ -144,12 +150,66 @@ namespace odb int value; // 4-byte signed integer containing value * 10,000. }; - //@@ TODO + // SQL_DATE_STRUCT + // + struct date + { + SQLSMALLINT year; + SQLUSMALLINT month; + SQLUSMALLINT day; + }; + + // SQL_SS_TIME2_STRUCT + // +#pragma pack(push,8) + struct time + { + SQLUSMALLINT hour; + SQLUSMALLINT minute; + SQLUSMALLINT second; + SQLUINTEGER fraction; + }; +#pragma pack(pop) + + // SQL_TIMESTAMP_STRUCT // - struct date {}; - struct time {}; - struct datetime {}; - struct datetimeoffset {}; + struct datetime + { + SQLSMALLINT year; + SQLUSMALLINT month; + SQLUSMALLINT day; + SQLUSMALLINT hour; + SQLUSMALLINT minute; + SQLUSMALLINT second; + SQLUINTEGER fraction; + }; + + // SQL_SS_TIMESTAMPOFFSET_STRUCT + // +#pragma pack(push,8) + struct datetimeoffset + { + SQLSMALLINT year; + SQLUSMALLINT month; + SQLUSMALLINT day; + SQLUSMALLINT hour; + SQLUSMALLINT minute; + SQLUSMALLINT second; + SQLUINTEGER fraction; + SQLSMALLINT timezone_hour; + SQLSMALLINT timezone_minute; + }; +#pragma pack(pop) + + // SQLGUID + // + struct uniqueidentifier + { + unsigned int data1; + unsigned short data2; + unsigned short data3; + unsigned char data4[8]; + }; } } |