jeudi 5 juin 2014

PL SQL Procedure warning compiled Error PLS-00103


Vote count:

0




I'm starting with PL/SQL, this is my first Procedure and I find it difficult to compile; I have tried so many different versions, I carry the last attempt. I don't understand why SQLDEVELOPER say me: "procedure compiled (with errors)".


The compiler say me:" Errore(10,1): PLS-00103: Trovato il simbolo (find) "DECLARE" instead: begin function pragma procedure subtype type current cursor delete exists prior "


If there are other errors (also logical) please tell me. I would like to improve.


Thank you all for the answers


My Procedure:



create or replace PROCEDURE calcola_giorn (giornata IN INTEGER) is
-- si tenga presente che in realtà giornata=idPartita
somma NUMBER;
idcal NUMBER;
nometorn VARCHAR2;
idformaz NUMBER;
nomesquadr VARCHAR2;

DECLARE;

SELECT idcalendario INTO idcal FROM partita WHERE id= giornata;

SELECT nometorneo INTO nometorn FROM calendario WHERE id= idcal;

CURSOR formazioni_di_giornata IS
SELECT id, nomesquadra FROM formazione where idpartita= giornata;

CURSOR giocatori_di_giornata IS
SELECT votogiocatore FROM schiera WHERE idformazione= idformaz;


Begin
OPEN formazioni_di_giornata;
FOR tupla_formazione IN formazioni_di_giornata LOOP
somma:=0;
FETCH formazioni_di_giornata INTO idformaz, nomesquadr;
OPEN giocatori_di_giornata;
FOR tupla_giocatore IN giocatori_di_giornata LOOP
somma:= somma + tupla_giocatore.votogiocatore;
END LOOP;
CLOSE giocatori_di_giornata;
UPDATE partecipa SET punti= somma WHERE ( (nomesquadra= nomesquadr) AND (nometorneo= nometorn));
END LOOP;
CLOSE formazioni_di_giornata;

EXCEPTION WHEN OTHERS THEN raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
END calcola_giorn;


asked 57 secs ago






Aucun commentaire:

Enregistrer un commentaire