Я заметил, что вы используете некоторый синтаксис сервера sql (например, числовой, varchar, deallocate), я исправил их и добавил несколько комментариев. Я также пишу курсор по-другому.
пожалуйста, проверьте код и скажите мне, если выдают ошибку.
DECLARE
CUR_ID_AUTORISATION NUMBER(2); -- it should be number instead and specific the size of the datatype
CUR_OPERATION VARCHAR(100); -- it should be varchar2 instead and specific the size
CURSOR CURAUTORISATIONS IS
SELECT AUT.ID_AUTORISATION
FROM PP3_AUTORISATION AUT
WHERE AUT.ID_PLAN IN (SELECT PDP.ID_PLAN
FROM PP3_PLAN_DE_PREVENTION PDP
WHERE PDP.ID_PLAN = 3059)
AND AUT.NUM_REVISION_PLAN =
(SELECT MAX(NUM_REVISION_PLAN)
FROM PP3_AUTORISATION
WHERE ID_PLAN = 3059);
CURSOR CUROPERATIONS IS
SELECT OPE.OPERATION
FROM PP4_OPERATION ope
WHERE ID_AUTORISATION IN
(select id_autorisation
from pp3_autorisation AUT
WHERE AUT.ID_PLAN = 3059
AND AUT.NUM_REVISION_PLAN =
(SELECT MAX(NUM_REVISION_PLAN) - 1
FROM pp3_autorisation
WHERE ID_PLAN = 3059));
-- OPEN CURAUTORISATIONS;
-- OPEN CUR_OPERATION;
--BEGIN
BEGIN
-- Open first cursor
for CUR_ID_AUTORISATION in CURAUTORISATIONS -- USING for loop cursor loop instead of open, and here you already fetched the data.
LOOP
EXIT WHEN CUROPERATIONS%NOTFOUND;
dbms_output.put_line('Hi');
-- Open second cursor
for CUR_OPERATION in CUROPERATIONS LOOP
dbms_output.put_line('Hi second time');
-- remove the comment.
INSERT INTO PP4_OPERATION
VALUES
(1, CUR_OPERATION.OPERATION, CUR_ID_AUTORISATION.ID_AUTORISATION);
end loop;
--close CURAUTORISATIONS;
--close CUROPERATIONS;
--DEALLOCATE(CURAUTORISATIONS); -- there is not deallocate in oracle
--DEALLOCATE(CUROPERATIONS); -- there is not deallocate in oracle
end loop;
end;
/