tags:

views:

205

answers:

1

I've managed to connect from SBCL running on debian to an SQL Server 2000 instance over the network using FreeTDS/unixODBC.

I can actually get data back from the server, so all is working.

However, many of the columns trigger what seem to be unsupported data types a-la:

The value 2147483647 is not of type FIXNUM.

and

-11 fell through ECASE expression. 
Wanted one of (-7 -6 -2 -3 -4 93 92 91 11 10 ...).

Anyone have experience using CLSQL with SQL Server would be able to help out?

A: 

This (error with 2147483647) occurs because the FreeTDS driver doesn't handle OLEDB BLOBs so well.

You have to issue the following SQL command to make it work:

set textsize 102400

You can see the FreeTDS FAQ entry here. Excerpt:

The text data type is different from char and varchar types. The maximum data length of a text column is governed by the textsize connection option. Microsoft claims in their documentation to use a default textsize of 4000 characters, but in fact their implementation is inconsistent. Sometimes text columns are returned with a size of 4 GB!

The best solution is to make sure you set the textsize option to a reasonable value when establishing a connection.

As for the ECASE expression, I haven't really solved it but I have hacked it away by doing a data conversion of timestamp into a binary value, and a uniqueidentifier into a varchar(36).

memet