Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pike
pike
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 105
    • Issues 105
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • pikelang
  • pikepike
  • Issues
  • #4354

Closed
Open
Opened Apr 13, 2007 by Peter Bortas@zinoOwner

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
Assignee
Assign to
Pike 7.8
Milestone
Pike 7.8
Assign milestone
Time tracking
None
Due date
None
Reference: pikelang/pike#4354