Home > Building Your Application > Editing the Employees Report > Create a Function
Previous |
Next |
First, create a function to calculate employees' salaries.
To create a function:
Click the Application link on the Developer toolbar (at the bottom of the page).
The Application home page appears.
Click the Home breadcrumb link in the title bar.
Click SQL Workshop and then SQL Commands.
SQL Commands provides a window where you can run PL/SQL against the database.
In the SQL editor, enter the following script:
CREATE OR REPLACE FUNCTION calc_remuneration( salary IN number, commission_pct IN number) RETURN NUMBER IS BEGIN RETURN ((salary*12) + (salary * 12 * nvl(commission_pct,0))); END;
Click Run.
The Results section displays this message:
Function created.