Ao criar a package conforme código abaixo, não estou conseguindo exito. Me são apresentadas as mensagens:
Compilation errors for PACKAGE BODY DESENV.PFUNC Error: PLS-00103: Encontrado o símbolo "LOPP" quando um dos seguintes símbolos era esperado: if Line: 52Text: end lopp;
Error: PLS-00103: Encontrado o símbolo "PFUNC" quando um dos seguintes símbolos era esperado: ;line: 54 Text: end pfunc;
Veja se é possivel me ajudar:
create or replace package body pfunc is
procedure consulta (pcd_mat in number := null,
pcd_depto in varchar2 := null,
pnr_cargo in number := null,
pnr_git in number := null,
ptab in out cfunc) is
begin
open ptab for
select cd_mat, nm_func, nm_sobrenome, in_sexo, nr_ramal,
vl_sal, dt_nasc, dt_adm, cd_depto, nr_cargo, nr_git
from func
where cd_mat = nvl(pcd_mat, cd_mat)
and cd_depto = nvl(pcd_depto, cd_depto)
and nr_cargo = nvl(pnr_cargo, nr_cargo)
and nr_git = nvl(pnr_git, nr_git);
end;
Procedure Atualiza(ptab in out tfunc,
ptipo in varchar2) is
I number := 1;
DUMMY number;
begin
while ptab.exists(I) loop
if upper(ptipo) = 'I' then
insert into func
(cd_mat, nm_func, nm_sobrenome, in_sexo, nr_ramal, vl_sal,
dt_nasc, cd_depto, nr_cargo, nr_git, dt_adm)
values
(seqmat.nextval, ptab(I).nm_func, ptab(I).nm_sobrenome,
ptab(I).un_sexo, ptab(I).nr_ramal, ptab(I).vl_sal,
ptab(I).dt_nasc, ptab(I).cd_depto, ptab(I).nr_cargo,
ptab(I).nr_git, sysdate);
else if upper(ptipo) = 'A' then
update func
set nm_func = nvl(ptab(I).nm_func, nm_func),
nm_sobrenome = nvl(ptab(I).nm_sobrenome, nm_sobrenome),
in_sexo = nvl(ptab(I).in_sexo, in_sexo),
nr_ramal = nvl(ptab(I).nr_ramal , nr_rama),
vl_sal = nvl(ptab(I).vl_sal, vl_sal),
dt_nasc = nvl(ptab(I).dt_nasc, dt_nasc),
cd_depto = nvl(ptab(I).cd_depto, cd_depto),
nr_git = nvl(ptab(I).nr_git, nr_git),
dt_adm = nvl(ptab(I).dt_adm, dt_adm)
where cd_mat = ptab(I).cd_mat;
elsif upper(ptipo) = 'E' then
delete from func
where cd_mat = ptab(I).cd_mat;
elsif upper(ptipo) = 'B' then
select 1 into dummy from func
where cd_mat = ptab(I).cd_mat for update;
end if;
i := I + 1;
end lopp;
end atualiza;
end pfunc;