Re: problem with a trigger
Date: Fri, 12 Dec 2003 13:16:47 GMT
Message-ID: <3djCb.74080$Pm4.2946156_at_phobos.telenet-ops.be>
"Guido Konsolke" <GK_at_oblivion.com> schreef in bericht
news:1071131818.828907_at_news.thyssen.com...
> "BlackEagle" <slimane_at_tsk.be> wrote...
> >
> > Thanx a lot Carlos ;)
> > the ')' and the language were the problems...
> > Now the triggers to their job but still I still get an error
> afterwards like
> > ora-06512: in "username.reservation_restrictions, line 3
> > ora-04088: failure by executing trigger
> 'username.reservation_restrictions'.
> > is this normal? because the trigger does his job, before these two
> errors I
> > get the message I want.
> >
> > thanks
> >
> Hi BlackEagle,
>
> sorry, 'disgusting' was a bit harsh but I prefer *real* names.
> Actually I did point you to one of your errors (if you re-read
> my answer you'll find it). To help you with your remaining
> problems it would be helpful to have a posting of the complete
> trigger.
>
> To let the rdbms show you errors at (well, after compile time) you
> can issue the 'show error trigger <trigger_name>' command. That will
> immediately point to the erroneous part(s) of the compiled code.
>
> Greetings,
> Guido
>
>
Ok Guido,
[Quoted] [Quoted] I know that you've pointed me to the errors.
I had read it but I couldn't figure out what you meant.
My other problem is this trigger.
insert into reservaties values (101,'14-DEC-2003');
(userid,res_date)
14 december 2003 is a sunday.
so by inserting this record, the trigger must do his job by not allowing [Quoted] this insertion.
CREATE TRIGGER res_sunday
BEFORE INSERT ON reservations
DECLARE
res_date date;
BEGIN
[Quoted] [Quoted] IF TO_NUMBER(TO_CHAR(to_date(res_date,'dd-mon-yyyy'),'d')) = 7
[Quoted] [Quoted] THEN raise_application_error(-20000,'We are closed on sunday');
END IF;
END;
/
Thanx in advance Received on Fri Dec 12 2003 - 14:16:47 CET
