Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!in.100proofnews.com!in.100proofnews.com!newsfeed.stueberl.de!news2.telebyte.nl!newshub1.home.nl!home.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!ecngs!feeder.ecngs.de!feed1.news.be.easynet.net!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail
Reply-To: "BlackEagle" <slimane@tsk.be>
From: "BlackEagle" <slimane@tsk.be>
Newsgroups: comp.databases.oracle.tools
References: <%BvBb.69580$oC2.2788492@phobos.telenet-ops.be> <1de5ebe7.0312100514.7aef50ec@posting.google.com> <UpNBb.71428$BP3.2930716@phobos.telenet-ops.be> <1071131818.828907@news.thyssen.com>
Subject: Re: problem with a trigger
Lines: 61
Organization: BlackEagle
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Message-ID: <3djCb.74080$Pm4.2946156@phobos.telenet-ops.be>
Date: Fri, 12 Dec 2003 13:16:47 GMT
NNTP-Posting-Host: 213.118.133.242
X-Complaints-To: abuse@telenet.be
X-Trace: phobos.telenet-ops.be 1071235007 213.118.133.242 (Fri, 12 Dec 2003 14:16:47 MET)
NNTP-Posting-Date: Fri, 12 Dec 2003 14:16:47 MET
Xref: newssvr20.news.prodigy.com comp.databases.oracle.tools:83960


"Guido Konsolke" <GK@oblivion.com> schreef in bericht
news:1071131818.828907@news.thyssen.com...
> "BlackEagle" <slimane@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,
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
this insertion.

CREATE TRIGGER res_sunday
BEFORE INSERT ON reservations
DECLARE
res_date date;
   BEGIN
   IF TO_NUMBER(TO_CHAR(to_date(res_date,'dd-mon-yyyy'),'d')) = 7
     THEN raise_application_error(-20000,'We are closed on sunday');
   END IF;
   END;
/

Thanx in advance



