A script-enabled browser is required for this page to function properly.

Creating or editing a formula column

To create or edit a formula column:

  1. In the Data Model view, single-click the Formula Column tool in the tool palette, then:

  2. Double-click the formula column object to display the Property Inspector.

  3. Under the Placeholder/Formula node, double click the PL/SQL Formula property value field.

  4. In the PL/SQL Editor, define the PL/SQL for the formula (for example, SAL * 0.07).

Example:   Referencing a PL/SQL function in formulas

Suppose that you have a report with the following groups and columns:

  
Groups  Columns         Summary
----------------------------------------
RGN     REGION
        RGNSUMSAL       SUM(DEPTSUMSAL)
		COSTOFLIVING
 		
DEPT    DNAME
        DEPTNO
		DEPTSUMSAL      SUM(EMP.SAL)
 
JOB     JOB
        HEADCOUNT       COUNT(EMP.EMPNO)
 
EMP     ENAME
        EMPNO
		SAL
		COMM

Given these groups and columns, you might create multiple formulas that apply the cost of living factor (COSTOFLIVING) to salaries. To avoid duplication of effort, you could create the following PL/SQL function and reference it from the formulas:

function CompSal(salary number) return number is
begin
  return (salary*CostofLiving);
end;

Following are some examples of how you might reference the PL/SQL function in formulas:

CompSal(:RGNSUMSAL)

or

CompSal(:SAL) + COMM

See also

About formula columns

Creating a summary column (for total or subtotals)