Desenvolvi uma procedure que possui mais de 20 funções. E fiz as devidas chamadas. Porém quero trazer as imformações dos retornos(saida) de cada função em um
type PIPELINED, tem como? Alguém pode me ajudar?
Let’s start our exploration of pipelined table functions (which I also refer to as PTFs in this article) by comparing a very simple regular (nonpipelined) table function with a very simple PTF.
First, I create a schema-level nested table type of strings.
Obrigada pelo links enviado. Na verdade o que eu preciso, seria um type com retorno dessas funções executadas.. Tipo, o resultado delas , pois será consulta em um front. Esta procedure é de cálculos.
create or replace PROCEDURE proc_motor ( p_ISS IN number,
p_COFINS IN number,
P_IR IN number,
P_IMPOSTO IN number,
P_TAXA IN number ) AS
--Retorno (Saida Funções Calculadas)
v_num1 NUMBER := 0;
v_num2 NUMBER := 0;
v_num3 NUMBER := 0;
-- type que receberá o retorno (Saida Funções Calculadas)
type tret_motor is record ( v_num1 number,
v_num2 number,
v_num3 number);
vretorno tret_motor;
-- função que retorna os valores (Saida Funções Calculadas)
function fun_ret_motor
return tret_motor
is
vret_motor tret_motor;
begin
--Retorno das funções-----------
--FUNCTION 1
v_num1 := fn_ISS( p_iss , p_COFINS );
--FUNCTION 2
v_num2 := fn_ir( P_IR, P_IMPOSTO);
--FUNCTION 3
v_num3 := fn_taxa( P_TAXA, P_IMPOSTO, p_ISS );
--Agora alimentamos o v_row a ser retornado
vret_motor.v_num1 := v_num1;
vret_motor.v_num2 := v_num2;
vret_motor.v_num3 := v_num3;
--
return vret_motor;
end fun_ret_motor;
--
begin
-- Chamada da função
vretorno := fun_ret_motor;
-- Print dos dados
dbms_output.put_line('FUNCTION 1: '||vretorno.v_num1);
dbms_output.put_line('FUNCTION 2: '||vretorno.v_num2);
dbms_output.put_line('FUNCTION 3: '||vretorno.v_num3);
end;