4.5.1 Working with Page and App Data Values

In the SQL and the PL/SQL you write directly in APEX pages and component definitions, use :NAME bind variable syntax to reference the data value of a page item or application item by name.

Some common examples include using bind variables in:

  • region SQL queries
  • WHERE clauses
  • local and shared component list of values
  • validations
  • page processes and workflow activities
  • server-side condition expressions, and
  • dynamic actions of type Execute Server-side Code.

Outside of data definition language (DDL) statements, anywhere SQL or PL/SQL allows an expression, you can use a bind variable instead. In PL/SQL, to change the value of a page item or application item use := to assign a value to a :NAME bind variable. For example, if business logic in page 5 needs to change the value of the P5_JOB page item to ANALYST if it currently has the value CLERK, then the PL/SQL code looks like this:

-- Change clerk to analyst
IF :P5_JOB = 'CLERK' THEN
   :P5_JOB := 'ANALYST';
END IF;