Re: Please help in creating a trigger

From: Galina <Galina.Self_at_cityofbristol.ac.uk>
Date: 6 Sep 2002 05:29:12 -0700
Message-ID: <af2b7239.0209060429.755a0a05_at_posting.google.com>


rs_arwar_at_hotmail.com (Rauf Sarwar) wrote in message news:<92eeeff0.0209051432.532a2184_at_posting.google.com>...
> Galina.Self_at_cityofbristol.ac.uk (Galina) wrote in message news:<af2b7239.0209050634.17f51afd_at_posting.google.com>...
> > Hello
> > We use Oracle 8 database in our college. An Oracle application from
> > outside supplier enables us to enrol students. Enrolments are
> > processed from many PCs on WAN, which includes several sites.
> > Recently the system started to behave a bit naughty: one very
> > important parameter, number of PC, on which the enrolment is
> > processed, SOMETIMES is not recorded in the database.
> > I need to create a trigger, which would have fired, if in the record
> > being inserted into the table there is NULL in the field, where should
> > be computer number. Ideally, I'd like to get this number (to read from
> > a file, for example), to insert it into the record and only then to
> > insert the record into the table. Is this possible? If yes, would you
> > mind to point me in the direction of a trigger code, which I could use
> > as an example.
> > If Oracle trigger cannot be programmed to read from a file, another
> > appropriate action would be to cancel inserting the record and to show
> > a message on the screen prompting the user to click SAVE button once
> > more. A sample of trigger code would be very appreciated.
> > Thank you.
> > Galina
>
>
> Why not make the column NOT NULL.
>
> //Rauf Sarwar

Because this column will be NULL in the majority of records. It should not be NULL, when some other conditions are met. I didn't write this in my message to make my question simpler. If I have an SQL code for the trigger, I'll manage to insert WHERE conditions (I hope). Also, it is a database created by an outside supplier and we can do such small developments as triggers, but we can't change field's properties.
Thank you for answering.
Galina Received on Fri Sep 06 2002 - 14:29:12 CEST

Original text of this message