how to fetch data from SQL server using Ruby?
I am using Selenium RC and Ruby. I want to fetch out data from a table in SQL Server 2005, using ODBC driver.
My connection code is:
conn = DBI.connect('DBI:ODBC:My_Data Source', 'username', 'password')
sth = conn.execute("SELECT * from table_name")
rows = sth.fetch_all
col_names = sth.column_names
This code connects Ruby to database but does not display the data from the table.
If any one has any idea, please share here.
Your help is highly appreciated.
Thanks in Advance.