Referencing a Package v11

To reference the types, items and subprograms that are declared within a package specification, we use the dot notation. For example:

package_name.type_name

package_name.item_name

package_name.subprogram_name

To invoke a function from the emp_admin package specification, we will execute the following SQL command.

SELECT emp_admin.get_dept_name(10) FROM DUAL;

Here we are invoking the get_dept_name function declared within the package emp_admin. We are passing the department number as an argument to the function, which will return the name of the department. Here the value returned should be ACCOUNTING, which corresponds to department number 10.