Bonjour,

Je suis en étude de développement d'application et pour mon projet on me demande de créer une procédure PL/SQL qui insère une ligne dans une table nommé FACTURE.
Voici mon code
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
 
CREATE OR REPLACE PROCEDURE NVFACTURE
(resid IN INTEGER) IS 
CURSOR cr IS SELECT res_id,clit_nom_societe,clit_nom,clit_prenom,clit_adresse,hot_nom,hot_adresse,hot_tel,hot_site_web,res_date_arr,res_date_dep,res_nb_nuits,cha_num,pr_prix,ser_fac_prix_total_ht from client,reservation,prix,chambre,hotels,services_fact,service_proposer
where resid=res_id and res_clit=clit_code and res_cha=cha_id and cha_prix=pr_id and cha_hot=hot_id and ser_fac_fac_id=res_id and ser_fac_ser_id=ser_prop_id;
montantht NUMBER(5,2);
totalserv NUMBER(5,2);
tva NUMBER(5,2);
montantttc NUMBER(5,2);
BEGIN
	select sum(ser_fac_prix_total_ht) into totalserv from services_fact where ser_fac_fac_id=resid;
	montantht:= x.res_nb_nuits*x.pr_prix+totalserv;
	tva:=montantht*0.196;
	montantttc:=montantht+tva;
	FOR X IN CR LOOP
		INSERT INTO FACTURE VALUES (sq_facture.NEXTVAL,sysdate,x.res_id,x.clit_nom_societe,x.clit_nom,x.clit_prenom,x.clit_adresse,x.hot_nom,x.hot_adresse,x.hot_tel,x.hot_site_web,x.res_date_arr,x.res_date_dep,x.res_nb_nuits,x.cha_num,x.pr_prix,totalserv,montantht,tva,montantttc);
		dbms_output.put_line('facture creer');
	END LOOP;
END;
Je suis sous oracle iSQL*Plus et il me renvoie les erreurs suivantes

LINE/COL ERROR
11/2 PL/SQL: Statement ignored
11/16 PLS-00225: référence de sous-programme ou de curseur 'OGC_X' est hors étendue

Je ne comprend pas du tout la seconde erreur et j'aurai aimé de plus amples information sur cette dernière.

Merci d'avance