 |
|
Oracle Tips by Burleson |
Validation
Methods
Validations are written to return a TRUE or
FALSE value. A return value of TRUE means the validation is
successful. A return value of FALSE means there is as an error.
SQL
Example:
select 1 from inventory_items
where item_id = :P100_ITEM_ID
and qty_available >= :P100_QTY_ORDERED;
-
: This is a good validation to use to prevent
the insert of a record that already exists. If a row is
found, the validation returns a false value indicating an
error. The syntax is the same as for the Exists example
above.
-
: Evaluates a SQL or PL/SQL expression and
returns a TRUE or FALSE value of the expression. This type of
validation is valuable, for example, checking that a birth
date is not some date in the future. It is also valuable for
comparing numeric values since page items are displayed in
alphanumeric format.
Example:
:P100_BIRTH_DATE <= SYSDATE
Example:
TO_NUMBER(:P100_AMOUNT_OWED)
= TO_NUMBER(:P100_AMOUNT_PAID)
The
above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create Dynamic
Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm
|
Download your Oracle scripts now:
www.oracle-script.com
The
definitive Oracle Script collection for every Oracle professional DBA
|
|