Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Before insert trigger code
Ranganath,
This is actually pretty complicated, but not impossible. You need to follow the method to avoid the "mutating table" error that I posted yesterday, since you need to select from the image_master table whilst also inserting into it.
Good luck, and let me know if you need any more info.
Regards,
Diana
-----Original Message-----
From: RanganathK_at_lgcommerznow.com [mailto:RanganathK_at_lgcommerznow.com]
Sent: Tuesday, November 28, 2000 2:20 AM
To: Multiple recipients of list ORACLE-L
Subject: Before insert trigger code
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.
TIA and regards, Received on Tue Nov 28 2000 - 09:22:10 CST