Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: why this trigger doesn't work??
Nope. PL/SQL is case-insensitive so it doesn't matter in which case you
reference NEW. As Niall Litchfield pointed out earlier, your main problem
was inconsistency in trigger name. It was GenerarID when created
and GenerarTipoExpedienteID when ENDed. All other errors were
caused by this one.
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "dani" <drezustam#QUITAESTO#@airtel.net> wrote in message news:alurr3$d2r$1_at_nsnmrro2-gest.nuria.telefonica-data.net...Received on Mon Sep 16 2002 - 04:10:01 CDT
> Ok, I did it:
> the error was that I wrote :
> INTO :new.ID
> and the right thing is :
> INTO :NEW.ID
>
> .... a rookie error........ sorry
>
>
> dani
>
>
> "dani" <drezustam#QUITAESTO#@airtel.net> escribió en el mensaje
> news:alseo8$cut$1_at_nsnmrro2-gest.nuria.telefonica-data.net...
> > I've created this trigger:
> >
> > CREATE OR REPLACE TRIGGER GenerarID
> > BEFORE INSERT ON TIPO_EXPEDIENTE
> > FOR EACH ROW
> > BEGIN
> > SELECT TIPOEXPEDIENTE_SQ.NEXTVAL
> > INTO :new.ID FROM dual;
> > END GenerarTipoExpedienteID;
> >
> > and when I make an insert:
> >
> > INSERT INTO TIPO_EXPEDIENTE (NOMBRE,DEPARTAMENTO)
> > VALUES ('PRUEBA','INFORMATICA');
> >
> > I get the error: ORA-04098: trigger 'GENERARID' is invalid and failed
> > re-validation
> >
> > The sentence SELECT TIPOEXPEDIENTE_SQ.NEXTVAL FROM dual; works fine and I
> > get answer.
> >
> > What is wrong?
> >
> > Thanks
> >
> >
>
>
![]() |
![]() |