What version of IDS you are using?
Always you use the "RETURN...WITH RESUME", this means your procedure will behave like a sql return. So, this way you can't return multiple lines inside only one variable!
You need to change the call of procedureB .
If you are using IDS 11.x you can access the procedure like this example :
Code:
create table teste(
cod integer, desc char(10), tipo char(1)
);
insert into teste values (1,'um',"a");
insert into teste values (2,'dois',"a");
insert into teste values (3,'tres',"b");
insert into teste values (4,'quatro',"b");
insert into teste values (5,'cinco',"c");
create procedure procb(pTipo char(1)) returning int,char(10);
define valA integer;
define valB char(10);
foreach cursorA for
select cod, upper(desc) into valA, valB from teste
where tipo = pTipo
return valA,valB with resume ;
end foreach
;
end procedure
;
create procedure procA() returning int,char(10);
define vTipo char(1);
define valA int;
define valB char(10);
foreach cursorA for
select unique tipo into vTipo from teste
order by 1 desc
foreach cursorB for
select col1,col2 into valA, valB from table(procb(vTipo)) (col1,col2)
return valA, valB with resume
;
end foreach
;
end foreach
;
end procedure
;
select * from table(proca()) myVirtual_table (colA,colB);
I am not sure, but with version 10 , maybe this works too.