Я пытаюсь создать новый пакет, но я получаю ORA-24344: success with compilation error
и не могу понять, в чем проблема.
Вот мой код:
CREATE OR REPLACE PACKAGE BODY lucratori_pack AS
CURSOR disp_lucrator RETURN LucratorRecType IS
SELECT ID_LUCRATOR, NUME_LUCRATOR, PRENUME_LUCRATOR, SALARIUL FROM LUCRATORI ORDER BY SALARIUL;
PROCEDURE increase_sal(
emp_id LUCRATORI.ID_LUCRATOR%type,
emp_inc_sal LUCRATORI.SALARIUL%type
)
IS
emp_new_sal LUCRATORI.SALARIUL%type;
BEGIN
UPDATE LUCRATORI
SET SALARIUL = SALARIUL + emp_inc_sal
WHERE LUCRATORI.id_lucrator = emp_id
returning SALARIUL INTO emp_new_sal;
END increase_sal;
PROCEDURE getAllEmps
IS
CURSOR c is
SELECT NUME_LUCRATOR, PRENUME_LUCRATOR FROM LUCRATORI;
c_nume LUCRATORI.NUME_LUCRATOR%type;
c_prenume LUCRATORI.PRENUME_LUCRATOR%type;
BEGIN
open c;
loop
EXIT WHEN c%NOTFOUND;
fetch c INTO c_nume, c_prenume;
dbms_output.put_line('Numele: ' || c_nume || ' Prenumele: ' || c_prenume);
end loop;
close c;
END getAllEmps;
END lucratori_pack;
Iпротестировали процедуры, и они не содержат ошибок.Ниже приведен код таблицы, которую я использую в 2 процедурах, объявленных внутри пакета:
CREATE TABLE Lucratori (
id_lucrator varchar2(5) constraint pk_lucrator primary key,
nume_lucrator varchar2(30),
prenume_lucrator varchar2(30),
data_nasterii date,
salariul number(5),
pozitia_ocupata varchar2(40),
id_companie varchar2(5),
constraint fk_lucrator_companie foreign key (id_companie)
references Companii(id_companie)
);