From: Martin Bonner Date: 2003-02-15T04:11:14+09:00 Subject: DBI, oracle, and prepare This is a multi-part message in MIME format. ------=_NextPart_000_00E9_01C2D42A.96A0A2E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi,=20 First, I'd like to thank you all for the help you've provided me in = the past, despite this being my first post here.=20 Now, my problem. I'm having some trouble with basic DBI functionality. = In its simplist form, my script: #!c:\ruby\bin\ruby.exe -w require 'DBI' begin dbh=3DDBI.connect("dbi:Oracle:db","user","password") sth=3Ddbh.prepare("insert into test_and_drop (id, descript) values = (?,?)") dbh.execute("1","Because") rescue DBI::DatabaseError =3D> e puts "An error occurred" print "Error Code: ", e.err, "\n" print "Error Message: ", e.errstr, "\n" ensure dbh.disconnect if dbh end=20 This is almost directly out of "Using the DBI Module" by Paul DuBios*, = so I would think that it would work, but, on the prepare, I'm getting: C:/ruby/lib/ruby/site_ruby/1.6/DBD/Oracle/Oracle.rb:34: warning: = discarding old to_i An error occurred Error Code: 1003 Error Message: ORA-01003: no statement parsed =20 I'm running ruby 1.6.7 on Win2K, connecting to an Oracle 8i db. Anybody = know what might be happening here? My hair is getting thinner by the = minute... :) Thank you, Marty *Credit where credit is due.. ------=_NextPart_000_00E9_01C2D42A.96A0A2E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
   First, I'd like to = thank you=20 all for the help you've provided me in the past, despite this being my = first=20 post here.
 
Now, my problem. I'm having = some trouble=20 with basic DBI functionality. In its simplist form, my = script:
#!c:\ruby\bin\ruby.exe = -w
require=20 'DBI'
 
begin
dbh=3DDBI.connect("dbi:Oracle:db","user","password")sth=3Ddbh.prepare("insert=20 into test_and_drop (id, descript) values=20 (?,?)")
dbh.execute("1","Because")
rescue DBI::DatabaseError = =3D>=20 e
   puts "An error occurred"
   print "Error = Code: ",=20 e.err, "\n"
   print "Error Message: ", e.errstr,=20 "\n"
ensure
   dbh.disconnect if dbh
end =
 
This is almost directly out of = "Using the=20 DBI Module" by Paul DuBios*, so I would think that it would work, but, = on the=20 prepare, I'm getting:
 
C:/ruby/lib/ruby/site_ruby/1.6/DBD/Oracle/Oracle.rb:34: = warning:=20 discarding old to_i
An error occurred
Error Code: 1003
Error = Message:=20 ORA-01003: no statement parsed
 
I'm running ruby 1.6.7 on = Win2K, connecting=20 to an Oracle 8i db. Anybody know what might be happening here? My hair = is=20 getting thinner by the minute...  :)
 
Thank you,
Marty
*Credit where credit is=20 due..
------=_NextPart_000_00E9_01C2D42A.96A0A2E0--