Skip to content

Instantly share code, notes, and snippets.

@chadj
Created March 5, 2009 16:10
Show Gist options
  • Save chadj/74413 to your computer and use it in GitHub Desktop.
Save chadj/74413 to your computer and use it in GitHub Desktop.
require 'dbi'
require 'dbd_odbc_patch'
dbh = DBI.connect("dbi:ODBC:DRIVER=FreeTDS;SERVERNAME=dbservername;DATABASE=MyDBName", "username", "password")
sth = dbh.prepare("select 1")
sth.execute
while row=sth.fetch do
p row
end
sth.finish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment