December 2010
Intermediate to advanced
451 pages
11h 16m
English
You need to randomly select employees from a collection. Using a random generator may select the same employee more than once, so you need to remove the record from the collection before selecting the next employee.
Invoke the built-in DELETE method on the collection. For example, the following code creates a collection of employees and then randomly selects one from the collection. The selected employee is removed from the collection using the DELETE method. This process is repeated until three employees have been selected.
DECLARE
CURSOR driver IS
SELECT last_name
FROM employees;
TYPE rec_type IS TABLE OF driver%ROWTYPE INDEX BY BINARY_INTEGER;
recs rec_type; j INTEGER; ...Read now
Unlock full access