Hi
I´m trying to use select_hash_first in ruby-plsql but i'm getting this error:
plsql.select_hash_first("SELECT 'abc' a, 123 b, 123.456 c from dual")
ArgumentError: No database object 'SELECT_HASH_FIRST' found
from c:/ruby/jruby-1.7.1/lib/ruby/gems/shared/gems/ruby-plsql-0.5.0/lib/plsql/schema.rb:182:in `method_missing'
from (irb):22:in `evaluate'
from org/jruby/RubyKernel.java:1066:in `eval'
from org/jruby/RubyKernel.java:1392:in `loop'
from org/jruby/RubyKernel.java:1174:in `catch'
from org/jruby/RubyKernel.java:1174:in `catch'
from c:/ruby/jruby-1.7.1/bin/jirb:13:in `(root)'
I'm using jruby 1.7.1, jdk 1.7.
select_hash_first is supported in jruby?
This is the test of ruby-plsql that show the use of select_hash_first
it "should execute SQL statement and return first result as hash" do
@now = Time.local(2008,05,31,23,22,11)
@conn.select_hash_first("SELECT 'abc' a, 123 b, 123.456 c,
TO_DATE('#{@now.strftime("%Y-%m-%d %H:%M:%S")}', 'YYYY-MM-DD HH24:MI:SS') d
FROM dual").should == {:a => "abc", :b => 123, :c => 123.456, :d => @now}
end
Thanks in advance