Preface |
|
xvii | |
Introduction to PL/SQL New Features in Oracle 21c |
|
xxiii | |
PL/SQL Extended Iterators |
|
xxiv | |
PL/SQL Qualified Expressions Enhancements |
|
xxiv | |
SQL Macros |
|
xxiv | |
New JSON Data Type |
|
xxiv | |
New Pragma SUPPRESSES_WARNING_6009 |
|
xxv | |
PL/SQL Type Attributes in Non-Persistable User-Defined Types |
|
xxvi | |
PL/SQL Function Enhanced Result Cache |
|
xxvii | |
|
Chapter 1 PL/SQL Concepts |
|
|
1 | (26) |
|
Lab 1.1 PL/SQL Architecture |
|
|
2 | (8) |
|
|
2 | (3) |
|
|
5 | (4) |
|
|
9 | (1) |
|
Lab 1.2 PL/SQL Development Environment |
|
|
10 | (8) |
|
Getting Started with SQL Developer |
|
|
10 | (3) |
|
Getting Started with SQL*Plus |
|
|
13 | (1) |
|
|
14 | (4) |
|
Lab 1.3 PL/SQL: The Basics |
|
|
18 | (7) |
|
DBMS_OUTPUT.PUT_LINE Statement |
|
|
18 | (3) |
|
Substitution Variable Feature |
|
|
21 | (4) |
|
|
25 | (2) |
|
Chapter 2 PL/SQL Language Fundamentals |
|
|
27 | (12) |
|
Lab 2.1 PL/SQL Language Components |
|
|
27 | (6) |
|
|
29 | (2) |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
33 | (1) |
|
Lab 2.2 Anchored Data Types |
|
|
33 | (2) |
|
Lab 2.3 Scope of a Variable, Block, Nested Blocks, and Labels |
|
|
35 | (3) |
|
|
35 | (1) |
|
|
36 | (2) |
|
|
38 | (1) |
|
|
39 | (10) |
|
Lab 3.1 SQL Statements in PL/SQL |
|
|
39 | (5) |
|
Initializing Variables with the SELECT INTO Statement |
|
|
40 | (1) |
|
Using DML Statements in a PL/SQL Block |
|
|
41 | (2) |
|
Using a Sequence in a PL/SQL Block |
|
|
43 | (1) |
|
Lab 3.2 Transaction Control in PL/SQL |
|
|
44 | (4) |
|
The COMMIT, ROLLBACK, and SAVEPOINT Statements |
|
|
44 | (3) |
|
The SET TRANSACTION Statement |
|
|
47 | (1) |
|
|
48 | (1) |
|
Chapter 4 Conditional Control: IF Statements |
|
|
49 | (16) |
|
|
50 | (5) |
|
|
50 | (2) |
|
|
52 | (3) |
|
|
55 | (4) |
|
Lab 4.3 Nested IF Statements |
|
|
59 | (3) |
|
|
61 | (1) |
|
|
62 | (3) |
|
Chapter 5 Conditional Control: CASE Statements |
|
|
65 | (20) |
|
|
65 | (9) |
|
|
66 | (2) |
|
|
68 | (6) |
|
|
74 | (4) |
|
Lab 5.3 NULLIF and coalesce Functions |
|
|
78 | (4) |
|
|
78 | (2) |
|
|
80 | (2) |
|
|
82 | (3) |
|
Chapter 6 Iterative Control: Part I |
|
|
85 | (26) |
|
|
86 | (6) |
|
|
87 | (4) |
|
|
91 | (1) |
|
|
92 | (5) |
|
|
92 | (3) |
|
Terminating the WHILE Loop Prematurely |
|
|
95 | (2) |
|
Lab 6.3 Numeric for Loops |
|
|
97 | (12) |
|
Using the IN Option in the Loop |
|
|
100 | (3) |
|
Using the REVERSE Option in the Loop |
|
|
103 | (1) |
|
Using Iteration Controls in the Loop |
|
|
104 | (4) |
|
Terminating the Numeric FOR Loop Prematurely |
|
|
108 | (1) |
|
|
109 | (2) |
|
Chapter 7 Iterative Control: Part II |
|
|
111 | (14) |
|
Lab 7.1 CONTINUE Statement |
|
|
111 | (8) |
|
Using the CONTINUE Statement |
|
|
112 | (4) |
|
Using the CONTINUE WHEN Statement |
|
|
116 | (3) |
|
|
119 | (3) |
|
|
119 | (1) |
|
|
120 | (2) |
|
|
122 | (3) |
|
Chapter 8 Error Handling and Built-in Exceptions |
|
|
125 | (10) |
|
|
125 | (3) |
|
Lab 8.2 Built-in Exceptions |
|
|
128 | (5) |
|
|
133 | (2) |
|
|
135 | (16) |
|
|
135 | (4) |
|
Lab 9.2 User-Defined Exceptions |
|
|
139 | (4) |
|
Lab 9.3 Exception Propagation |
|
|
143 | (6) |
|
|
148 | (1) |
|
|
149 | (2) |
|
Chapter 10 Exceptions: Advanced Concepts |
|
|
151 | (10) |
|
Lab 10.1 RAISE_APPLICATION_ERROR |
|
|
151 | (4) |
|
Lab 10.2 EXCEPTION_INIT Pragma |
|
|
155 | (2) |
|
Lab 10.3 SQLCODE and SQLERRM |
|
|
157 | (3) |
|
|
160 | (1) |
|
Chapter 11 Introduction to Cursors |
|
|
161 | (20) |
|
Lab 11.1 Types of Cursors |
|
|
162 | (9) |
|
|
162 | (2) |
|
|
164 | (7) |
|
Lab 11.2 Table-Based and Cursor-Based Records |
|
|
171 | (4) |
|
|
172 | (2) |
|
|
174 | (1) |
|
Lab 11.3 Cursor for Loops |
|
|
175 | (2) |
|
|
177 | (2) |
|
|
179 | (2) |
|
Chapter 12 Advanced Cursors |
|
|
181 | (20) |
|
Lab 12.1 Parameterized Cursors |
|
|
181 | (5) |
|
Lab 12.2 Cursor Variables and Expressions |
|
|
186 | (10) |
|
|
187 | (6) |
|
|
193 | (3) |
|
Lab 12.3 For update Cursors |
|
|
196 | (3) |
|
|
199 | (2) |
|
|
201 | (20) |
|
Lab 13.1 What Triggers Are |
|
|
201 | (12) |
|
|
202 | (3) |
|
|
205 | (5) |
|
|
210 | (1) |
|
|
211 | (2) |
|
Lab 13.2 Types of Triggers |
|
|
213 | (6) |
|
Row and Statement Triggers |
|
|
213 | (2) |
|
|
215 | (4) |
|
|
219 | (2) |
|
Chapter 14 Mutating Tables and Compound Triggers |
|
|
221 | (8) |
|
|
221 | (2) |
|
Lab 14.2 Compound Triggers |
|
|
223 | (5) |
|
|
228 | (1) |
|
|
229 | (30) |
|
|
230 | (10) |
|
|
231 | (2) |
|
|
233 | (3) |
|
|
236 | (4) |
|
|
240 | (5) |
|
Lab 15.3 Multidimensional Collections |
|
|
245 | (2) |
|
Lab 15.4 Collection Iteration Controls and Qualified Expressions |
|
|
247 | (11) |
|
Collection Iteration Controls |
|
|
247 | (4) |
|
|
251 | (7) |
|
|
258 | (1) |
|
|
259 | (14) |
|
Lab 16.1 User-Defined Records |
|
|
259 | (6) |
|
|
260 | (2) |
|
Qualified Expressions with Records |
|
|
262 | (1) |
|
|
263 | (2) |
|
|
265 | (3) |
|
Lab 16.3 Collections of Records |
|
|
268 | (3) |
|
|
271 | (2) |
|
Chapter 17 Native Dynamic SQL |
|
|
273 | (16) |
|
Lab 17.1 EXECUTE IMMEDIATE Statements |
|
|
274 | (9) |
|
EXECUTE IMMEDIATE Statement |
|
|
275 | (8) |
|
Lab 17.2 OPEN FOR, FETCH, and CLOSE Statements |
|
|
283 | (4) |
|
|
287 | (2) |
|
|
289 | (30) |
|
Lab 18.1 FORALL Statements |
|
|
290 | (9) |
|
|
290 | (4) |
|
|
294 | (2) |
|
|
296 | (1) |
|
|
297 | (2) |
|
Lab 18.2 The BULK COLLECT Clause |
|
|
299 | (9) |
|
Lab 18.3 Binding Collections in SQL Statements |
|
|
308 | (10) |
|
Binding Collections with EXECUTE IMMEDIATE Statements |
|
|
308 | (6) |
|
Binding Collections with OPEN FOR, FETCH, and CLOSE Statements |
|
|
314 | (4) |
|
|
318 | (1) |
|
|
319 | (12) |
|
Lab 19.1 Creating Nested Procedures |
|
|
320 | (7) |
|
|
320 | (1) |
|
|
321 | (5) |
|
|
326 | (1) |
|
Lab 19.2 Creating Stand-Alone Procedures |
|
|
327 | (3) |
|
|
330 | (1) |
|
|
331 | (10) |
|
Lab 20.1 Creating Nested Functions |
|
|
331 | (5) |
|
Lab 20.2 Creating Stand-Alone Functions |
|
|
336 | (4) |
|
|
340 | (1) |
|
|
341 | (16) |
|
Lab 21.1 Creating Packages |
|
|
341 | (7) |
|
Creating a Package Specification |
|
|
342 | (1) |
|
|
343 | (5) |
|
Lab 21.2 Package Instantiation and Initialization |
|
|
348 | (3) |
|
Package Instantiation and Initialization |
|
|
349 | (2) |
|
|
351 | (1) |
|
Lab 21.3 SERIALLY_REUSABLE Packages |
|
|
351 | (5) |
|
|
356 | (1) |
|
Chapter 22 Stored Code Advanced Concepts |
|
|
357 | (22) |
|
Lab 22.1 Subprogram Overloading |
|
|
357 | (6) |
|
Lab 22.2 Result-Cached Functions |
|
|
363 | (3) |
|
Lab 22.3 Invoking PL/SQL Functions from SQL Statements |
|
|
366 | (9) |
|
Invoking Functions in SQL Statements |
|
|
367 | (1) |
|
Using Pipelined Table Functions |
|
|
368 | (2) |
|
|
370 | (5) |
|
|
375 | (4) |
|
Chapter 23 Object Types in Oracle |
|
|
379 | (20) |
|
|
380 | (8) |
|
|
381 | (4) |
|
Using Object Types with Collections |
|
|
385 | (3) |
|
Lab 23.2 Object Type Methods |
|
|
388 | (10) |
|
Using Constructor Methods |
|
|
389 | (3) |
|
|
392 | (1) |
|
|
393 | (1) |
|
|
393 | (5) |
|
|
398 | (1) |
|
Chapter 24 Storing Object Types in Tables |
|
|
399 | (12) |
|
Lab 24.1 Storing Object Types in Relational Tables |
|
|
400 | (3) |
|
Lab 24.2 Storing Object Types in Object Tables |
|
|
403 | (2) |
|
|
405 | (5) |
|
|
410 | (1) |
|
Chapter 25 Dynamic SQL with the DBMS_SQL Package |
|
|
411 | (10) |
|
Lab 25.1 Generating Dynamic SQL with the DBMS_SQL Package |
|
|
412 | (8) |
|
|
420 | (1) |
|
Appendix A PL/SQL Formatting Guide |
|
|
421 | (4) |
|
|
421 | (1) |
|
|
421 | (1) |
|
|
422 | (1) |
|
|
423 | (2) |
|
Appendix B Student Database Schema |
|
|
425 | (8) |
|
Table and Column Descriptions |
|
|
425 | (8) |
Index |
|
433 | |