From: Brian Candler Date: 2007-05-30T23:40:32+09:00 Subject: Re: Help with Ruby < - > Oracle Connectivity On Wed, May 30, 2007 at 11:12:02PM +0900, Peter Bailey wrote: > I know that I'm able to use and > connect with my database using SQLPlus, which came with the client. My > "tnsnames.ora" file shows this: > ... > (ADDRESS = (PROTOCOL = TCP)(HOST = graphicsdb-prod.bna.com)(PORT = > 1521)) > ... Unfortunately, you've missed out the important bit, which is what goes where the first "..." is. That's the service name, and that's the name you use to refer to the host when connecting to it. > I'm using DBI here, but, I'm ignorant. I don't know whether I need to > use it or not. It's all I've found in googling around to do this. The homepage for ruby-oci8 is at http://ruby-oci8.rubyforge.org/ You can use this directly - it's a simple enough API. Using the DBI layer around this means that in theory you can write code which talks to databases other than Oracle. But that's only true if you don't use any Oracle-specific SQL. If you want an OO abstraction layer, look at ActiveRecord. > But, anyway, nothing you suggest is working for me. "Nothing is working" is not helpful. Unless you show exactly what you tried, and exactly what error(s) you got - cut and paste - then I'm not going to be able to help you. Showing a working sqlplus command line would also be extremely helpful. Basically, the same parameters you give there should be usable in your oci8 connect string. Brian.