Closed jgebal closed 8 years ago
It can't for now. The following prints Foo objects only.
conn = OCI8.new(username, password)
class Foo < OCI8::Object::Base
end
class Bar < Foo
end
cursor = conn.parse("BEGIN :result := get_object(:use_var); END;")
cursor.bind_param(1, nil, Foo)
cursor.bind_param(2, false)
cursor.exec
p cursor[1] # => Foo
cursor.bind_param(2, true)
cursor.exec
p cursor[1] # => This should prints Bar, but Foo.
I'll fix it before the next ruby-oci8 release.
The issue was fixed by https://github.com/kubo/ruby-oci8/commit/4276bef164e69ee832cb2871a2eb8423f71b6912. Wait ruby-oci8 2.2.2 or use the master branch on github as follows.
$ git clone --depth=1 https://github.com/kubo/ruby-oci8.git
$ cd ruby-oci8
$ gem build ruby-oci8.gemspec # create a gem file
$ gem install ./ruby-oci8-2.2.1.gem # install the created gem file
I'd like to be able to map objects returned by this function, any clues on how to do it in ryby, assuming that the base object can have many child objects?
Any help and advice will be appreciated.