How To Create Validation on Oracle Apex
How To Create Validation on Oracle Apex
Topic Introduction: In this tutorial, we will discuss How To Create Validation on Oracle Apex. To insert data on the table we have some restrictions so that the user can not make an error or can't insert wrong data we use many kinds of validation. now we will show how to make a validation on an insert form which will check employee salary before insert. If the present updated salary is double the previous salary validation shows a massage and prevents inserting data.
Follow the instruction:
1. Create a Validation
2. Select the Validation type: Function Body(returning boolean)
3. Select Language: PL/SQL
4. Write PL/SQL Code on PL/SQL Function Body:
DECLAREV_Sal number;BEGINSELECT SalaryINTO V_SalFROM EmployeesWHERE Employee_ID=:P100_EMPLOYEE_ID;IF V_Sal*2 < :P100_SALARYTHENreturn TRUE;ELSIFreturn FALSE;END IF;END;
5. Write an error message in the Error Message box.
Note: This is a basic validation example to understand easily. You can write your Validation following the structure.
No comments