When creating a new record, I want to check if the entered value for a particular field (unique key) does not already exist. I mean, it should be unique.
How can I check this in Oracle Apex?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check for a field value uniqueness using validation in Oracle Apex. Follow these steps:
Do the right-click on your page item and select the Create Validation option.
Select its validation type as No Rows Returned.
Specify the following SQL query in the SQL query field:
In the Error Message field, specify the error message:
Employee code already exists.
For serverside condition, specify the CREATE button for the When button pressed drop-down.
Below is the screenshot of the above settings:
The above validation will execute only when the Create button is pressed. It will check if the employee code already exists, and if it exists, it will abort the page submission and give the error message.