I'm developing a function that read from one table and inserts into another:
The error is: Warning: Function created with compilation errors.
I've removed the select line and it works. So, the error is in it.
create or replace function FC_INS_TIPO_GASTO
return number
as
v_numSubCota transparencia_gastos.numSubCota%type;
v_txtDescricao transparencia_gastos.txtDescricao%type;
begin
select distinct numSubCota into v_numSubCota, txtDescricao into
v_txtDescricao
from transparencia_gastos
where sgUF='PB' or sgUF='PE';
insert into tipo_gasto
(cod_tipo_gasto, des_tipo_gasto, dtc_cadastro)
values
(v_numSubCota, v_txtDescricao, systimestamp);
return 0;
end;
/
Can not select dentin from begin end? But I've already tested out of the block and it does not work either.