class DBI::DBD::OCI8::BindType::DBIStatementHandle


sth.fetch_all
# fetch column data.
sth = plsql.func(:bind_value, 1)
# Get the first parameter, which is a DBI::StatementHandle.
plsql = dbh.execute(“begin test_pkg.tab_table(?); end;”, DBI::StatementHandle)
# The first parameter is bound as DBI::StatementHandle.
# Execute test_pkg.tab_table.
EOS
end;
end;
open csr for select * from tab;
begin
procedure tab_table(csr out ref_cursor) is
create or replace package body test_pkg is
dbh.execute(<<EOS)
# Create package body
EOS
end;
procedure tab_table(csr out ref_cursor);
type ref_cursor is ref cursor;
create or replace package test_pkg is
dbh.execute(<<EOS)
# Create package
helper class to bind ref cursor as DBI::StatementHandle.

def get()

def get()
  val = super
  return nil if val.nil?
  stmt = DBI::DBD::OCI8::Statement.new(val)
  DBI::StatementHandle.new(stmt, *DBI_STMT_NEW_ARGS)
end

def set(val)

def set(val)
  if val.is_a? DBI::StatementHandle
    # get OCI8::Cursor
    val = val.instance_eval do @handle end
    val = val.instance_eval do @cursor end
  end
  super(val)
end