[odb-users] Problem compiling for MS-SQL

Oded Arbel oded at geek.co.il
Wed Jul 25 10:38:20 EDT 2012


On Wed, Jul 25, 2012 at 5:02 PM, Boris Kolpackov
<boris at codesynthesis.com> wrote:
> Oded Arbel <oded at geek.co.il> writes:
>
>>               #pragma db type("NVARCHAR(9)")
>>               std::string ppd;
>
> There is no default mapping between std::string and SQL Server national
> character types (NVARCHAR, NCHAR, and NTEXT) since those are UTF-16
> types. There is, however, a mapping for std::wstring so this will work:
>
> #pragma db type("NVARCHAR(9)")
> std::wstring ppd;

Thanks! I've read it at
http://www.codesynthesis.com/products/odb/features.xhtml , but
apparently it didn't register much.

Fixing this and couple of other similar issues removed the errors.

>> ... I tried to "hello"
>> example for MS-SQL (into which I added a simple class that is build
>> similar to the above - with all the private/protected/public stuff)
>> and it builds just fine.
>
> Hm, that's strange. Did you also include the type("NVARCHAR(9)") part?

No, I did not. my bad, sorry...

The error didn't seem to me to indicate an issue with the type
mapping, but now I know better :-)

-- 
Oded



More information about the odb-users mailing list