Search code examples
pythondatabasesap-iq

how do I query Sybase IQ server using odbc?


How can I query Sybase IQ server from a script such as Python or Perl using ODBC? I searched on internet but I couldn't find a sample connection string. Could someone provide a sample connection string for this?

the details i have for connection are server name and database schema name. (and username and password).

example using isql is

isql -S SERVER_IQ -D schema_name -U username -P password

Above connection works when i specify correct details. I need a corresponding connection string using odbc driver or Sybase IQ drivers.

Thanks.

Regards, Alok


Solution

  • Perl provides an easy to use interface which is not the same for Python on R. Anyways, i found the solution from our DBA. I use following connection string to open the Sybase IQ connection

    "Driver={Sybase IQ};UID=username; PWD=*******; ServerName=SERVERNAME; CommLinks=SharedMemory,TCPIP{host=server.sg.planet.com;port=111}"
    

    Regards, Alok