Creating computations is done from the page
definition page. The example shown below will create a
computation to query the database for the full name of a
customer. A condition is set to only execute this computation
if the current value of the page item is null.
Click on the in
the Computations area under Page Processing.
On the Item Location page select the Computation Location
and click Next.
On the Item page:
Select the Compute Item for which
the computation is created.
Set the Sequence to the order in
which the computation is to execute.
Select the Computation Point.
For this example, After Submit was chosen, so it executes
when the page is submitted.
Select the Computation Type. For
this example, PL/SQL Function Body was chosen.
On the Computation page enter the source code for your
computation and click Next. In this example, PL/SQL Function
Body was chosen and the code is shown below.
for r in (
select salutation, first_name, last_name
where customer_id = :P100_CUSTOMER_ID )
s_full_name := r.salutation
|| ' ' || r.first_name
|| ' ' || r.last_name;
On the Condition page select the Condition Type and enter
the Expressions as necessary. The following example shows the
information entered as:
Condition Type: Value of Item in Expression 1 is NULL.
Expression 1: P100_FULL_NAME.
Finally, click the Create button.