In Oracle Apex, you can get an item value in PL/SQL using two ways. The following are the examples:
Get an Item Value Using Colon (:) in Oracle Apex
Just specify the Colon (:) before an item name when referring an item in PL/SQL code in Oracle Apex. This is called the Bind variable method. Please see below example:
Declare v_student_name student.st_name%type; Begin v_student_name := :P2_ST_NAME; End;
This method is also used for SQL statements. So when your condition or action type is SQL Statement, you can specify the page item with a colon, as demonstrated in the above example.
Getting Item Value using V() Function in Oracle Apex
You can use V()
function to get the page item value in PL/SQL code. Check the below example:
Declare v_student_name student.st_name%type; Begin v_student_name := V('P2_ST_NAME'); End;
Leave a comment