Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

The Sybase IQ release docs list Ruby native and DBI driver support. Details on how to connect are not listed but the page does link to the Sybase SQLAnywhere for Ruby page. So I downloaded the SQLAnywhere for Ruby driver and built the gem (installing from rubygems gave seg faults).

What I can't figure out is what the connection string should be.

The MySQL connection in DBI looks like DBI.connect("DBI:Mysql:mydbname;host=myhostname;port=myport", "myuser", "mypassword")

Using the same format for IQ only gives me 'Not connected to a database (DBI::DatabaseError)'

Any help would be appreciated.

asked 08 Jun '11, 15:14

morgandev's gravatar image

accept rate: 100%

I saw both those docs and the ones listed with the gem. It was just a matter of getting the params right by combining the port with the host name. Here is what worked for me using IQ.

DBI.connect("DBI:SQLAnywhere:DBN=mydbn;HOST=myhostname:myport", "myuser", "mypassword")

permanent link

answered 08 Jun '11, 17:37

morgandev's gravatar image

accept rate: 100%

The connect() call parameters are documented in the SQL Anywhere Ruby-DBI driver documentation page. There are also some examples on this same page.

Basically the first parameter is of the form "DBI:SQLAnywhere:<server-name>" or "DBI:SQLAnywhere:<connection-parameter-list>" where <server-name> is the name of the server to which you want to connect and <connection-parameter-list> is an semicolon separated key=value pairs (e.g. "server=myserver;dbn=mydatabase;host=myhost").

permanent link

answered 08 Jun '11, 16:54

Mark%20Culp's gravatar image

Mark Culp
accept rate: 41%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 08 Jun '11, 15:14

question was seen: 3,620 times

last updated: 08 Jun '11, 17:37