dbi:oci8 problems

  • Thread starter Glauco Magnelli
  • Start date


Glauco Magnelli

Hi, I've a problem with dbi:eek:ci8. I hope that you could help me.
My code is this:

1 require 'dbi'
2 dbh = DBI.connect("dbi:eek:ci8:service_name", "user", "password")
3 rs = dbh.prepare('SELECT * FROM table')
4 rs.execute
5 while rsRow = rs.fetch do
6 p rsRow
7 end
8 rs.finish
9 dbh.disconnect if dbh

I've installed correctly all I need (DBI, OCI8, ...), but I get this

attr.c:178:in oci8lib.so: ORA-24316: illegal handle type
from /usr/lib/ruby/site_ruby/1.8/oci8.rb:1591:in `initialize'
from /usr/lib/ruby/site_ruby/1.8/oci8.rb:780:in `new'
from /usr/lib/ruby/site_ruby/1.8/oci8.rb:780:in
from /usr/lib/ruby/site_ruby/1.8/oci8.rb:779:in `collect'
from /usr/lib/ruby/site_ruby/1.8/oci8.rb:779:in
from /usr/lib/ruby/site_ruby/1.8/DBD/OCI8/OCI8.rb:346:in
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:666:in `column_names'
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:646:in `execute'
from test.rb:14

If I comment lines 4-5-6-7 is all ok: load driver, connect and prepare.
I dont't understand what is the problem, the same code with Mysql driver
is ok.
Can you help me?

Thanks, paco



Glauco Magnelli

Now it's ok, you can view the solution on ruby-oci8 forum. Thanks to
Kubo Takehiron for his help.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question