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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Checking for Overlaping Date Range

Re: Checking for Overlaping Date Range

From: DanHW <danhw_at_aol.com>
Date: 1998/01/19
Message-ID: <19980119015601.UAA24554@ladder02.news.aol.com>#1/1

>In my program, the users need to enter two dates which
>represent the vacation range, which, supposedly, not
>to overlap with other vacation ranges. If there is vacations
>in the databases, I can check the newly input data against
>them. However, if there is not, i have to check the ranges
>record by record before i commit them. Then the problem
>comes:-
>
>1. I can't use Post-Record, When-Validate, Post-Text-Item
> types of triggers cos i need to loop thru the records
> to check (it involves GO_RECORD(#);
>2. I can't check in Key-Commit trigger before the command
> COMMIT cos i'll use RAISE FORM_TRIGGER_FAILURE to stop
> the program when there is overlapping date range. The
> reason is RAISing such failure activates a dialog box
> which ask me whether i want to save the changes. It
> gives me "Yes, No, and Cancel" options. So, the users can
> save those overlapping dates...
>3. I can't use PL/SQL table which acts as an array in Form.
> Because my version PL/SQL doesn't support such useful
> function.
>
>Then what should i do? Pls rescue me! :P
>Thanks in advance!!!
>
>
>Thenard
>
>

It is a real pain, but what you need to do is create a RECORD_GROUP in the form with the dates, populate it and keep it in sync with the screen. Then, in the WHEN-VALIDATE you loop through the members of the record group, which you can do in the WHEN-VALIDATE trigger. If you find a violation, you display an appropriate message, do do the appropriate action. One note - you will have to read all the rows in so the record group has all the relevant data.

Dan Received on Mon Jan 19 1998 - 00:00:00 CST

Original text of this message

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