Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
Message: 58373
BY: Glauco Magnelli (paco)
DATE: 2008-07-09 13:45
SUBJECT: dbi:oci8 problems

 

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

1 require 'dbi'
2 dbh = DBI.connect("dbi:oci8: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
error:

attr.c:178:in oci8lib.so: ORA-24316: illegal handle type
(DBI::DatabaseError)
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
`column_metadata'
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
`column_metadata'
from /usr/lib/ruby/site_ruby/1.8/DBD/OCI8/OCI8.rb:346:in
`column_info'
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


Thread View

Thread Author Date
dbi:oci8 problemsGlauco Magnelli2008-07-09 13:45
      RE: dbi:oci8 problemsErik Hollensbe2008-07-09 22:03
      RE: dbi:oci8 problemsGlauco Magnelli2008-07-10 18:11

Post a followup to this message