Problem with unixODBC on linux
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=4354
Reported by Marcus Wellhardh wellhard@roxen.com
Got the following error when trying to execute a query to a MSSQL 2000 server:
Pike v7.7 release 30 running Hilfe v3.5 (Incremental Pike Frontend)
> object db = Sql.Sql("odbc://test:test@burns/");
> db->query("Select * from Region");
odbc->fetch_row(): SQLGetData() failed:
SQLError failed (-1:SQL_NO_DATA_FOUND)
src/modules/Odbc/odbc_result.c:648: Odbc.odbc_result()->fetch_row()
test-install/pike/7.7.30/lib/modules/Sql.pmod/Sql.pike:367:
Sql.Sql()->res_obj_to_array(Odbc.odbc_result())
test-install/pike/7.7.30/lib/modules/Sql.pmod/Sql.pike:495:
Sql.Sql()->query("Select * from Region")
The applications tsql (freetds native client) and isql (unuxODBC client) can execute the query. The query does also work if you disable winde string support in the pike ODBC module.
Client: leguan.roxen.com FreeTDS: 0.64 unixODBC: 2.2.11 pike: 7.7.30 and 7.4
~ $ cat .odbc.ini [burns] Driver = FreeTDS Server = burns.roxen.com Port = 1433 Database = Northwind
~ $ cat /etc/odbcinst.ini [FreeTDS] Description = FreeTDS unixODBC Driver Driver = /usr/local/lib/libtdsodbc.so UsageCount = 1
~ $ cat /usr/local/etc/freetds.conf
[...]
[burns]
host = burns.roxen.com
port = 1433