Previous |
Next |
This tutorial shows how to use the SQL Developer tool Edit to declare a RECORD
type, sal_info
, whose fields can hold salary information for an employee—job ID, minimum and maximum salary for that job ID, current salary, and suggested raise.
To declare RECORD type sal_info:
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.
Right-click EMP_EVAL.
A list of choices appears.
Click Edit.
The EMP_EVAL
pane opens, showing the CREATE
PACKAGE
statement that created the package.
In the EMP_EVAL
pane, immediately before END emp_eval
, add this code:
TYPE sal_info IS RECORD ( j_id jobs.job_id%type , sal_min jobs.min_salary%type , sal_max jobs.max_salary%type , sal employees.salary%type , sal_raise NUMBER(3,3) );
A new EMP_EVAL
pane opens, showing the changed CREATE
PACKAGE
statement. The title of the pane is in italic font, which indicates that the changes have not been saved to the database.
Click the icon Compile.
The changed package specification compiles and is saved to the database. The title of the EMP_EVAL
pane is no longer in italic font.
Now you can declare records of the type sal_info
, as in "Tutorial: Creating and Invoking a Subprogram with a Record Parameter".