J
Jason Vogel
Sorry to bug you. I can't figure this out.
create or replace package ruby_test is
function f_ruby(s in number,t out varchar2,st out
common_func.STRING_TABLE)
return varchar2;
end ruby_test;
/
create or replace package body ruby_test is
function f_ruby(s in number,t out varchar2,st out
common_func.STRING_TABLE)
return varchar2
is
begin
t := 'outta here';
st(1) := 'array 1';
st(2) := 'array 2';
return 'Ruby rocks '||TO_CHAR(s)||' times!';
end;
begin
null;
end ruby_test;
/
cursor = conn.parse("BEGIN :result := ruby_test.f_ruby(s => :in,t =>
ut,st => ut_array); END;")
cursor.bind_param(':in', 10)
cursor.bind_param(':result', nil, String, 100)
cursor.bind_param('ut', nil, String, 100)
cursor.bind_param('ut_array', StringArray?)
cursor.exec()
p cursor[':result'] # => 'Ruby rocks 10 times!'
p cursor['ut'] # => 'outta here'
p cursor['ut_array'] # => 'st(1) = array 1, st(2) = array 2'
I can't figure how what it takes to get the arrays to work.
Help....
Thanks,
Jason
create or replace package ruby_test is
function f_ruby(s in number,t out varchar2,st out
common_func.STRING_TABLE)
return varchar2;
end ruby_test;
/
create or replace package body ruby_test is
function f_ruby(s in number,t out varchar2,st out
common_func.STRING_TABLE)
return varchar2
is
begin
t := 'outta here';
st(1) := 'array 1';
st(2) := 'array 2';
return 'Ruby rocks '||TO_CHAR(s)||' times!';
end;
begin
null;
end ruby_test;
/
cursor = conn.parse("BEGIN :result := ruby_test.f_ruby(s => :in,t =>
ut,st => ut_array); END;")
cursor.bind_param(':in', 10)
cursor.bind_param(':result', nil, String, 100)
cursor.bind_param('ut', nil, String, 100)
cursor.bind_param('ut_array', StringArray?)
cursor.exec()
p cursor[':result'] # => 'Ruby rocks 10 times!'
p cursor['ut'] # => 'outta here'
p cursor['ut_array'] # => 'st(1) = array 1, st(2) = array 2'
I can't figure how what it takes to get the arrays to work.
Help....
Thanks,
Jason