Re: problem with a trigger

From: BlackEagle <slimane_at_tsk.be>
Date: Wed, 10 Dec 2003 12:05:51 GMT
Message-ID: <z_DBb.70238$SK1.2652271_at_phobos.telenet-ops.be>


"Guido Konsolke" <GK_at_oblivion.com> schreef in bericht news:1071045434.204269_at_news.thyssen.com...
> Hi BlackEagle (disgusting!),
> commets embedded...
>
> "BlackEagle" wrote...
> > Hi everyone,
> > I have a table reservations with user-id, date... in it.
> > Now I found a trigger to prevent people make changes on table
> reservations
> > on sunday and any day before 7 am and after 23 pm.
> > it looks like this but I keep get an error like "trigger built with
> > compilation failure"
> > what can I do to resolve this?
>
> Let the rdbms show you the errors...
>
> >
> > CREATE TRIGGER reservations_restriction
> > BEFORE
> > DELETE OR INSERT OR UPDATE
> > ON reservations
> >
> > BEGIN
> > IF TO_CHAR(SYSDATE, 'DY') = 'sun')
>
> -------------------------------------------------^
>
> > THEN raise_application_error( -20501,
> > ' blah blah blah');
> > END IF;
> (snip)
> >
> > and another question, in table reservations, I want to prevent
> people make
> > reservations for sundays. because the business is closed that day.
> > what can I add in the trigger for that, or what kind of check
> constraint can
> > I use instead.
>
> Since the check constraint is limited in what you can use within,
> I would add procedural logic to your trigger. Catch the start and end
> date
> and do some maths (hints: day of week, subtraction, addition).
>
> >
> > ps. don't know if it does a matter but I'm using oracle 9i on xp
> > to connect to the db username/pwd _at_oradb
>
> It's always good and sometimes essential to know...
>
> >
> > thanx in advance...
>
> hth,
> Guido
>
>
I've sent the code of my script, can't you please tell me what's wrong with it
what must I do to let the rdbms show me the errors? I only get the message that the trigger was built with compilation errors. and what do you mean with disgusting? Received on Wed Dec 10 2003 - 13:05:51 CET

Original text of this message