[freetds] Problems with nvarchar

Johnny Ljunggren johnny at navtek.no
Mon May 12 11:48:04 EDT 2003


I have this system:
MS SQL 2000 sp2, freetds-0.62.dev.20030508, unixODBC-2.2.5

I have made a small test database on the SQL-server:
 DB name: JCTest
 One table with name: text
 One column with name: textcol
 Datatype and length: nvarchar 20

One entry in the table:
 textcol = 'Excellent test' 

If I run the isql-program that comes with unixODBC, I connect OK and try
this statement:
select * from text;
That should return 'Excellent test' but return this:
+---------------------+
| text                |
+---------------------+
|                     |
+---------------------+
1 rows affected
1 rows returned

If I enter the same statement again I get this:
[unixODBC]Changed database context to 'JCTest'.
[unixODBC]Changed language setting to us_english.
[unixODBC]Option not supported
[ISQL]ERROR: Could not SQLExecute

If I change data type to 'char' or length to i.e. 50 then suddenly
everything works as it should.

How is this possible? What do I do wrong?

I'm fairly new to this, so I'm not sure if it's the fault of me, FreeTDS
or unixODBC. Any pointers to fixing this problem will be greatly
appreciated.

-- 
Johnny Ljunggren, Priv: Bærefjellvn 15, 3160 STOKKE
Tlf: 33 07 10 77 (jobb) 918 50 411 (mob) 33 33 62 52 (priv)



More information about the FreeTDS mailing list