rsim/ruby-plsql-spec — Issue #9: Table of object types as input parameter problem
Author: jaaknt
Created: 2011-10-26 21:07:50+00:00
State: open

Hi,

I have problem with table of object types as input parameter - Oracle procedure receives always NULL.
Table of object types as out parameter works without problems, also object type as in or out parameter works.

My test case

DROP TYPE t_test_rec FORCE;
CREATE OR REPLACE TYPE t_test_rec AS OBJECT
(amt NUMBER);
/

CREATE OR REPLACE TYPE t_test_tbl AS TABLE OF t_test_rec;
/

CREATE OR REPLACE PROCEDURE x_test (i_test_tbl in t_test_tbl)
IS
begin
IF i_test_tbl IS NULL THEN
DBMS_OUTPUT.PUT_LINE('i_test_tbl is null');
ELSE
DBMS_OUTPUT.PUT_LINE('i_test_tbl.COUNT ' || i_test_tbl.COUNT);
END IF;
end;
/

x_spec.rb
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Test" do

it "Test" do
result = plsql.x_test(:i_test_tbl => [{:amt => 12}, {:amt => 34}])
end

end

plsql-spec run spec/x_spec.rb --dbms_output
Running specs from spec/x_spec.rb
DBMS_OUTPUT: i_test_tbl is null