-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path10g_indices_of.sql
More file actions
44 lines (35 loc) · 1.08 KB
/
Copy path10g_indices_of.sql
File metadata and controls
44 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
SELECT employee_id FROM employee WHERE salary = 10000
/
DECLARE
TYPE employee_aat IS TABLE OF employees.employee_id%TYPE
INDEX BY PLS_INTEGER;
l_employees employee_aat;
TYPE boolean_aat IS TABLE OF BOOLEAN
INDEX BY PLS_INTEGER;
l_employee_indices boolean_aat;
BEGIN
l_employees (1) := 7839;
l_employees (100) := 7654;
l_employees (500) := 7950;
--
l_employee_indices (1) := TRUE;
l_employee_indices (500) := TRUE;
l_employee_indices (799) := TRUE;
--
FORALL l_index IN INDICES OF l_employee_indices
BETWEEN 1 AND 500
UPDATE employees
SET salary = 10000
WHERE employee_id = l_employees (l_index);
END;
/
SELECT employee_id FROM employees WHERE salary = 10000
/
ROLLBACK
/
/*======================================================================
| Supplement to the fifth edition of Oracle PL/SQL Programming by Steven
| Feuerstein with Bill Pribyl, Copyright (c) 1997-2009 O'Reilly Media, Inc.
| To submit corrections or find more code samples visit
| http://oreilly.com/catalog/9780596514464/
*/