Bonjours a toutes et tous

voici mon pb : je cherche a faire une fonvtion qui va me récupérer des valeur dans des table lors d'un insert. J'ai donc un trigger mais comme je peux avoir plusieur ligne de resultat a traiter je dois donc utiliser un curseur. Seulement voila le problème c'est que cela ne marche point.
Auriez vous une idée? Je vous joint le code qui me parrais le plus problable de ce qui devrai etre correcte syntaxiquement mais j'ai toujour une erreur au niveau du fatch quoi que je fasse apres.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
DECLARE
cur 		refcursor;		
num_lot_fab	"Production"."PR_Sortie_stock"."num_lot_fabrication"%TYPE;
code_article	"Production"."PR_Ligne_fabrication"."code_article"%TYPE;
pcb		"Production"."PR_Ligne_fabrication"."pcb"%TYPE;
nb_unite_fab	"Production"."PR_Ligne_fabrication"."nb_unite_fabrique"%TYPE;
alveole		"Production"."PR_Ligne_fabrication"."new_alveole"%TYPE;
 
BEGIN
	UPDATE "Production"."PR_Stock_Courant" SET "nb_uc" = "nb_uc"-NEW."nb_uc"
	 WHERE "Numero_Lot" = NEW."num_lot_fabrication"
	  AND "Code_Alveole" = NEW."Code_Alveole"
	  AND "qte_uc"=New."poids_uc";
 
	IF NEW."type_sortie_stock" = 1
	THEN
		BEGIN work;
		OPEN cur FOR
		SELECT "num_lot_fabrication"|| EXTRACT(DOY FROM now()),"PF_Articles"."Code_article","PR_Ligne_fabrication"."pcb", "PR_Ligne_fabrication"."nb_unite_fabrique", "PR_Ligne_fabrication"."new_alveole"
		FROM "Production"."PR_Ligne_fabrication","ProduitsFinis"."PF_Articles"
		WHERE "PR_Ligne_fabrication"."code_article"="PF_Articles"."Code_article"
		AND "PR_Ligne_fabrication"."num_lot_fabrication"=NEW."num_lot_fabrication";
 
		FETCH ALL IN cur; --INTO num_lot_fab,code_article,pcb,nb_unite_fab,alveole;
 
		WHILE cur%FOUND
 
		LOOP
 
			INSERT INTO "ProduitsFinis"."PF_Entree_Stock"
			("Numero_Lot","Code_Article", "nb_uc", "qte_uc","type_entree_stock","date_entree_stock","heure_entree_stock","Code_Alveole")
			VALUES (num_lot_fab, code_Produit,nb_unite_fab, pcb,NEW."type_sortie_stock", now(), NOW(),alveole);
		ind = ind + 1
		END LOOP;
		CLOSE cur;
		COMMIT work;
	END IF;
 
RETURN NEW;
END;
Merci d'avance de vos réponses