SQL*Forms 2.3 PRE-INSERT and PRE-UPDATE Triggers

From: Soo K. Lee <skl1_at_Ra.MsState.Edu>
Date: 16 Sep 93 14:26:02 GMT
Message-ID: <skl1.748189562_at_Ra.MsState.Edu>


I am having a problem in inserting a new record in a block. This block is single row block but has one to many relationship with master block.

The Form must behave like this:

  1. When a user tries to create new records, a field called effective_date has to be the latest among existing records' effective_dates.
  2. When a user tries to update an existing record, if the effective_date is the same date as the previous date in the record, then update the existing record directly otherwise insert a brand new record with the new effective_date. (of course this date has to be the latest.)

To solve this problem, I tried to use Pre-Insert and Pre-Update triggers. I used a global variable to hold the effective_date on the current block. Then tried to reference it in a select statement to compare with the latest effective_date from existing records but it did not allow me to do so.

Any comment will be greatly appreciated.

Soo Kyoung Lee
e-mail: earth.msstate.edu Received on Thu Sep 16 1993 - 16:26:02 CEST

Original text of this message