Re: does active record really work for oracle

Dave Rose
Fri, 24 Aug 2007 16:07:20 -0000

Dave Rose add:
def dba_connect
tns="railt"
puts "NOW LOGGING ONTO BANNER #{tns}"
OCI8.new("scott","tiger","#{tns}")
rescue OCIException
puts "NOW LOGGING ONTO BANNER #{tns}.WORLD"
OCI8.new("scott","tiger","#{tns+".WORLD"}")
end
nil
$conn=dba_connect
 LOGGING ONTO BANNER railt
#<OCI8:0x30c9fc4 @privilege=nil, @ctx=[0, #<Mutex:0x30c9f88>, nil,
65535], @
#<OCISvcCtx:0x30c9f74>, @prefetch_rows=nil>
recs=$conn.exec("Desc Users")
Error: ORA-00900: invalid SQL statement
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in
`execute''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in `exec''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:129:in
`do_ocicall''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in `exec''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:204:in `exec''
     from (irb):20
recs=$conn.exec("Desc users")
Error: ORA-00900: invalid SQL statement
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in
`execute''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in `exec''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:129:in
`do_ocicall''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:597:in `exec''
     from C:/ruby186/ruby/lib/ruby/site_ruby/1.8/oci8.rb:204:in `exec''
     from (irb):21
but
recs=$conn.exec("select * from users") ....does