Procedure stockee - Probleme de refresh et Commit
Bonjour,
j'ai une procédure stockée qui fonctionne, voici le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| PROCEDURE inserer_equipement_type_cult (ident IN VARCHAR2 , DETAILS IN VARCHAR2 , NBSALLES IN NUMBER , CARACTYPECULT IN VARCHAR2 , SURFETABCULT IN NUMBER ) AS
BEGIN
LOCK TABLE PRU_EQUIPEMENT_TYPE_CULT IN EXCLUSIVE MODE;
BEGIN
SELECT MAX(OBJECTID) INTO obid FROM PRU_EQUIPEMENT_TYPE_CULT;
if obid IS NULL then
obid := 0;
else
obid := obid +1;
end if;
INSERT INTO PRU_EQUIPEMENT_TYPE_CULT ( OBJECTID , IDENT , DETAILS , NB_SALLES , CARAC_TYPE_CULT , S2_ETAB_CULT ) VALUES(obid , ident , details , nbsalles , caractypecult , surfetabcult );
END; --end du premier begin
END inserer_equipement_type_cult; |
voici celle qui ne fonctionne pas :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| PROCEDURE inserer_equipement_type_cult (ident IN VARCHAR2 , DETAILS IN VARCHAR2 , NBSALLES IN NUMBER , CARACTYPECULT IN VARCHAR2 , SURFETABCULT IN NUMBER ) AS
BEGIN
LOCK TABLE PRU_EQUIPEMENT_TYPE_CULT IN EXCLUSIVE MODE;
BEGIN
SELECT MAX(OBJECTID) INTO obid FROM PRU_EQUIPEMENT_TYPE_CULT;
if obid IS NULL then
obid := 0;
else
obid := obid +1;
end if;
INSERT INTO PRU_EQUIPEMENT_TYPE_CULT ( OBJECTID , IDENT , DETAILS , NB_SALLES , CARAC_TYPE_CULT , S2_ETAB_CULT ) VALUES(obid , ident , details , nbsalles , caractypecult , surfetabcult );
END; --end du premier begin
BEGIN
REFRESH ON COMMIT AS
SELECT * FROM PRU_EQUIPEMENT_TYPE_CULT;
END;
END inserer_equipement_type_cult; |
Le message d'erreur est le suivant :
Citation:
Error(48,19): PLS-00103: Symbole "ON" rencontré à la place d'un des symboles suivants : := . ( @ % ;
la ligne 48 est celle qui est indiqué en rouge.
j'essaye de rafraichir ma base de donnes juste apres mon insertion pour que les donnes soient disponibles encore plus vite que ca ne l'ait deja.
Merci d'avance pour votre aide