Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011

    Question Unanswered: Simple Trigger Question..

    Hey All,
    Can somebody please tell me how to do something?

    I want to create a trigger that is run every time a record is inserted into a particular table. This is easy.

    What I want is to fire the trigger from an insert on 1 table and do somthing on another.

    so In my case i have

    create or replace trigger decrement_available
    after insert
    on BOOKING
    so basicaly I have a foreign key in the record just entered into the BOOKING table. I want to then find the referenced record (using the foreign key in the record just entered) and modify something in that record.

    so I guess so basic pseudo code would be such

    before (or after) insert record on BOOKING table
    Find record of the foreign key in the TOY table
    Modify a field in that record to subtract it by one.

    I know this should be so simple but I cant find ANY good material in books or internet with syntax etc for triggers. Lots of info on how they work etc.. :-( :-(

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts