Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Roman Rozinov
RE: FreeTDS + Ruby DBI + MS Sql [ reply ]  
2009-03-04 06:13
Thank you Erik. Installing ruby-odbc fixed it. I had to make sure that unixODBC-devel is also installed for anyone who is following my path.

By: Erik Hollensbe
RE: FreeTDS + Ruby DBI + MS Sql [ reply ]  
2009-03-03 08:52
You need to install ruby-odbc. It's not available as a gem so we can't include it as a prerequisite. If I had more time, I would handle this myself. :)

http://www.ch-werner.de/rubyodbc/

By: Roman Rozinov
RE: FreeTDS + Ruby DBI + MS Sql [ reply ]  
2009-03-03 06:44
Ok, I am still struggling guys.
So, i had to rebuild my CentOs box.
i have rails 2.2.2 with 2.1.0 frozen in the app. I have brought down dbi 0.4.1 and dbd-odbc0.2.4 and now I get this error:
DBI::InterfaceError (Unable to load driver 'ODBC' (underlying error: uninitialized constant DBI::DBD::ODBC)
I would appreciate any leads.

By: Erik Hollensbe
RE: FreeTDS + Ruby DBI + MS Sql [ reply ]  
2009-02-17 00:28
Sorry I haven't gotten back to you yet.

In this case, the only thing I can suggest to you is to inspect the hash that is returned as it may be provided under a different key; we only can provide the information provided to us, and at this point it is very dependent on the underlying driver.

-Erik

By: Roman Rozinov
RE: FreeTDS + Ruby DBI + MS Sql [ reply ]  
2009-02-11 07:01
What are your errors with regard to metadata failures?
I am having a problem where ActiveRecord sql_adapter is having a problem running a query to inspect columns of a sql_server odbc datasourced table.

By: Rakesh Ramakrishnan
FreeTDS + Ruby DBI + MS Sql [ reply ]  
2008-03-10 15:11
hi all,

I am using Ruby DBI + FreeTDS + MS Sql Server 2005 for my development. I was successful in making a connection to the database and execute different database operations. But I have problems in retrieving the metadata about columns in a table. I am trying to retrieve the primary keys of a table but I am not able to do so. I have pasted the sample code below which fails

DBI.connect('dbi:ODBC:tosqlserver', 'xyz', 'abcde') do | dbh |


sth = dbh.execute('select * from DataPreprocess')
rows = sth.fetch_all
puts sth.methods

sth.column_info.each_with_index do |info,i|
printf "primary: %s\n",info["primary"]
end
sth.finish

end

Could u please suggest a solution or an alternate way to retrieve the primary keys of the table ?