Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
dbi:oci8 problems
Glauco Magnelli
7/8/2008 12:14:00 PM
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
--
Posted via
http://www.ruby-...
.
1 Answer
Glauco Magnelli
7/10/2008 6:10:00 PM
0
Now it's ok, you can view the solution on ruby-oci8 forum. Thanks to
Kubo Takehiron for his help.
Bye
paco
Glauco Magnelli wrote:
> 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
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
dbi:oci8 problems
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password