Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Before insert trigger code

Before insert trigger code

From: <RanganathK_at_lgcommerznow.com>
Date: Tue, 28 Nov 2000 12:50:04 +0530
Message-Id: <10693.123032@fatcity.com>


Dear all,

     I have a table by name image_master whose structure is as below:

 IMAGE_NAME                                             NOT NULL
VARCHAR2(60)
 TYPE                                                              NOT NULL
CHAR(1)
 START_DT                                                  NOT NULL
VARCHAR2(8)
 EXPIRY_DT
VARCHAR2(8)
 IMAGE_DESC
VARCHAR2(600)
 CREATE_DT
VARCHAR2(8)
 MODIFY_DT
VARCHAR2(8) The dates are entered in the form 'yyyymmdd'. All the dates have been assigned the datatype as varchar2(8) instead of date for a specific reason. I would like to create a before insert trigger on the table so that the user cannot insert a record if the start_dt and expiry_dt overlap the existing start_dt and expiry_dt in the existing records. For example, if there is a record whose start_dt is 20001126 and end_dt is 20001128 then the user is not allowed to have start_dt and end_dt between 26th and 28th November, 2000 (both dates inclusive). His start_dt and end_dt can be any dates apart from 26th, 27th and 28th November. How do I implement this using SQL or PL/SQL? Is there any other way out apart from creating a before insert trigger? I hope I am clear. Any help in this regard will be highly appreciated. Received on Tue Nov 28 2000 - 01:20:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US