December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to execute some code each time a particular PL/SQL package is instantiated in a session.
Create an initialization block for the package in question. By doing so, you will have the ability to execute code each time the package is initialized. The following example shows the same package that was constructed in Recipe 4-7. However, this time the package contains an initialization block.
CREATE OR REPLACE PACKAGE BODY process_employee_time IS
PROCEDURE grant_raises (pct_increase IN NUMBER,
upper_bound IN NUMBER) as
CURSOR emp_cur is
SELECT employee_id, first_name, last_name
FROM employees;
BEGIN -- loop through each record in the employees ...Read now
Unlock full access