Previous |
Next |
This tutorial shows how to use the SQL Developer tool Edit to declare variables and constants in the EMP_EVAL
.calculate_score
function (specified in "Tutorial: Creating a Package Specification"). (This tutorial is also an example of changing a package body.)
To declare variables and constants in calculate_score function:
On the Connections tab, expand the hr_conn
information by clicking the plus sign (+) to the left of the hr_conn
icon.
Under the hr_conn
icon, a list of schema object types appears.
Expand Packages.
A list of packages appears.
Expand EMP_EVAL.
A list appears.
Right-click EMP_EVAL Body.
A list of choices appears.
Click Edit.
The EMP_EVAL
Body pane appears, showing the code for the package body.
Between RETURN
NUMBER
AS
and BEGIN
, add these variable and constant declarations:
n_score NUMBER(1,0); -- variable n_weight NUMBER; -- variable max_score CONSTANT NUMBER(1,0) := 9; -- constant, initial value 9 max_weight CONSTANT NUMBER(8,8) := 1; -- constant, initial value 1
From the File menu, select Save.
Oracle Database saves the changed package body.