Hi All,
This is ranjit,i am porting oracle procedures to db2 .,when i am doing facing problem at "bulk collect ",please help me out how to solve this.
below i added oracle package and equaltent db2 package which is throwing error at bulk collect.
--------------------------------------------------------------------------------------------
drop table test_table ;
create table test_table
(
col1 number (20, 0),
col2 number (1, 0)
) ;
insert into test_table values (1,2) ;
insert into test_table values (3,4) ;
commit;
--------------------- Oracle procedure ------------
drop type test_t ;
drop type test ;
create type test as object
(
c1 number (20, 0),
c2 number (1, 0)
) ;
/
create type test_t as table of test ;
/
create or replace procedure testprocedure (test_t_obj out test_t )
is
begin
select test(col1,col2) bulk collect into test_t_obj from test_table ;
end testprocedure ;
/
declare
test_t_obj_pram test_t := test_t () ;
begin
testprocedure(test_t_obj_pram) ;
dbms_output.put_line('>>>>>>>>>>'||test_t_obj_pram .count) ;
end ;
/
------------------ DB2 Facing issue at Bulk collect--------
drop type test_t ;
drop type test ;
create type test as row
(
c1 number (20, 0),
c2 number (1, 0)
) ;
create type test_t as test array integer ;
create or replace procedure testprocedure (test_t_obj out test_t )
is
begin
select test(col1,col2) bulk collect into test_t_obj from test_table ;
//// GETTING ERROR HERE about test(col1,col2)
end testprocedure ;
/
declare
test_t_obj_pram test_t := test_t () ;
begin
testprocedure(test_t_obj_pram) ;
dbms_output.put_line('>>>>>>>>>>'||test_t_obj_pram .count) ;
end ;
/
Thanks & Regards,
ranjit