Press "Enter" to skip to content

Oracle Apex PL/SQL Expression Example

In this post, I am giving the Oracle Apex PL/SQL expression example to validate a text field. Not only for validation, but you can also use the PL/SQL expressions for more purposes in Oracle Apex.

Oracle Apex PL/SQL Expression Example

In the below example, it is creating validation for the SAL column, which must be greater than 1000.

To create the PL/SQL expression for the SAL column, select the SAL field in the content body region and do the right click on it and select Create Validation option.

In the Validation section, select the type as PL/SQL Expression and then in the text area enter :sal > 1000 as shown in the below image:

Oracle Apex Validation Section.
Illustrating PL/SQL expression to validate a text field in Oracle Apex. Image by FoxInfotech.

Now if the condition evaluates to TRUE, means the SAL is > 1000 then it is OK; else it will raise the error.

Oracle Apex PL/SQL Function Body (Returning boolean) Example

You can write the above condition for type PL/SQL Function Body (returning boolean) as well. To write the validation as demonstrated above, enter the following code into the text area, as shown below:

  if :sal > 1000 then
     return true;
     return false;
  end if;

See also:

Have you found the answer to your question? If not, you can discuss it with me in the comments section below or join my Q&A community for developers and ask your question. It is FREE.

Vinish Kapoor


Hi, I am a full stack developer and writing about development. I document everything I learn and help thousands of people. is created, written, and maintained by me; it is built on WordPress, and hosted by Bluehost. Connect with me on Facebook, Twitter, GitHub, and get notifications for new posts.

Inline Feedbacks
View all comments