11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

534<br />

END;<br />

/* Method 2: Call a generic procedure to check the date<br />

** range. This way our date check can be used in<br />

** any validation trigger where we want to check<br />

** that a starting date in a range comes before<br />

** the ending date. Another bonus is that with the<br />

** error message in one standard place, i.e. the<br />

** procedure, the user will always get a<br />

** consistent failure message, regardless of the<br />

** form they’re currently in.<br />

*/<br />

BEGIN<br />

Check_Date_Range(:Experiment.Start_Date,:Experiment.End_Date);<br />

END;<br />

/*<br />

** The procedure looks like this<br />

*/<br />

PROCEDURE Check_Date_Range( d1 DATE, d2 DATE ) IS<br />

BEGIN<br />

IF d1 > d2 THEN<br />

Message(’Your date range ends before it starts!’);<br />

RAISE <strong>Form</strong>_trigger_Failure;<br />

END IF;<br />

END;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!