Salve a tutti,
Mi sto esercitando con i trigger e mi sono imbattuto in questi errori, seguenti a questo trigger
codice:
create or replace trigger T_Ordine
before insert on Ordine
for each row
DECLARE
t_o excpetion;
BEGIN
select *
from Ordine join Rivenditore on Ordine.CF_Rivenditore = Rivenditore.CF
join Cliente on Cliente.CF_Rivenditore = Rivenditore.CF
where Ordine.ID_Cliente = Cliente.ID;
if :new.CF_Rivenditore <> Cliente.CF_Rivenditore then
raise t_o;
end if;
EXCEPTION
when t_o then
raise_application_error(-20002,'Un rivenditore non puo ricevere ordini da un cliente non suo');
end;
/
Gli errori invece sono:
0/0 PL/SQL: Compilation unit analysis terminated
2/5 PL/SQL: Item ignored
2/5 PLS-00201: identifier 'EXCPETION' must be declared
5/1 PLS-00428: an INTO clause is expected in this SELECT statement
10/1 PL/SQL: Statement ignored
10/34 PLS-00357: Table,View Or Sequence reference
'CLIENTE.CF_RIVENDITORE' not allowed in this context
15/6 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
Qualcuno mi può spiegare anche orientativamente a cosa sono dovuti questi errori? GRAZIE!