You are on page 1of 8

PL/SQL Training

AUDIENCE: Database administrators, application developers, and database operators.


PREREQUISITES: Familiarity with Oracle Database 10g database technology; an understanding of the
basic concepts of relational databases and the SQL programming language; ability to write queries
against single and multiple tables, manipulate data in tables, create database objects, and query
metadata. For beginners in SQL there are on-line trainings SQL Fundamentals I Express Guide (30
hours) and SQL Fundamentals II Express Guide (15 hours).
LEARNING OBJECTIVES: Skills in writing simple stored procedures (including triggers) in PL/SQL
using control structures, cursors and records.

Day 1.
1. Self-study using C.Allen “Oracle PL/SQL 101” (Chapter 8), consulting teacher,
performing corresponding exercises from the book.

1. What is PL/SQL (0.5 hour)


1. PL/SQL in general
2. SQL, PL/SQL и SQL*Plus
3. Stored procedures, functions, triggers
4. Stored procedures and SQL-scripts

2. Structure of PL/SQL block (0.5 hour)


1. Header
2. Exercise Fig.8-1.
3. Declarations
4. Executable section
5. Exceptions

3. Procedures and functions call (0.5 hour)


1. Procedures and functions call
2. Exercise Fig.8-2.

4. Variables and constants in PL/SQL (0.5 hour)


1. Declaration of variable in PL/SQL
2. Declaration of constant in PL/SQL
3. Assigning value to a variable
4. Exercises Fig.8-3, 8-4.
5. Using variables

2. Online training in MyLearning (Introduction to PL/SQL) - 3 hours.

3. Online training in MyLearning (Creating Stored Procedures and Functions) – 3


hours.
Day 2.

4. Self-study using C.Allen “Oracle PL/SQL 101” (Chapter 8), consulting teacher,
performing corresponding exercises from the book.

5. Control structure in PL/SQL (1.5 hour)


1. Operator IF
2. Exercise Fig.8-5
3. Loops
a. LOOP
b. Exercise Fig.8-6
c. Loop WHILE
d. Exercise Fig.8-7
e. Loop FOR
f. Exercise Fig.8-8
4. Cursors
5. Cursor declaration and cursor attributes
6. Records in PL/SQL
7. Commands OPEN, FETCH и CLOSE
8. Cursor loop FOR
9. Instruction WHERE CURRENT OF
10. Exercise Fig.8-9
11. Nested loops
12. Exercise Fig.8-10

5. Online training in MyLearning (Using Control Structures) – 2 hours.

6. Self-study using C.Allen “Oracle PL/SQL 101” (Chapter 8), consulting teacher,
performing corresponding exercises from the book.

6. Error handling (1 hour)


1. Exceptions
2. System exceptions
3. Exercise Fig.8-11
4. Exceptions defined by programmer
5. Exercise Fig.8-12

7. Answering control questions for Chapter 8 of the book to teacher (0.5 hour).

8. Online training in MyLearning (Explicit Cursors and Exception Errors) – 3 hours.

Day 3.

9. Self-study using C.Allen “Oracle PL/SQL 101” (Chapter 8), consulting teacher,
performing corresponding exercises from the book.
7. Coding conventions (0.5 hour)

8. PL/SQL and Oracle server interaction (1 hour)


1. Dynamic declaration of variable types in PL/SQL
2. Exercise Fig.9-1
3. DML in PL/SQL, or implicit cursors
4. Exercise Fig.9-2 – 9-5
5. Explicit and implicit cursors

9. Time operations (0.5 hour)


1. Time measuring in a program
2. Exercise Fig.9-6, 9-7
3. Command TIMING for real time counting
4. Exercise Fig.9-8

10. PL/SQL packages (1 hours)


1. Package syntax
2. Exercise Fig.9-9

10. Online training in MyLearning (PL/SQL Packages) – 2 hours.

11. Triggers (1 hours)


1. Trigger types
2. Exercise Fig.9-10
3. Trigger modification
4. Details for triggers

12. ODBC (1 hours)


1. Creation of ODBC-connection
2. Exercise Fig.9-11 – 9-17.
3. View and edit Access database
4. Exercise Fig.9-18 - 9-20.
5. Import Oracle data into Excel
6. Exercise Fig.9-21 – 9-23.

11. Answering control questions for Chapter 8 of the book to teacher (1 hour).

12. Online training in MyLearning (Using PL/SQL with an Oracle Server) – 2 hours.

Day 4.

13. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 3), consulting
teacher, performing corresponding exercises from the book.
13. Additional control structures (1 hour)
1. CASE instruction
a. CASE without ELSE
b. CASE with label
c. CASE with search
d. Exercise case.sql
2. GOTO operator
a. GOTO and labels
b. Exercise goto.sql

14. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 4), consulting
teacher, performing corresponding exercises from the book.

14. SQL and PL/SQL (5 hours)


1. SQL operators
a. Using SQL in PL/SQL
b. Using dynamic SQL
2. DML in PL/SQL
a. SELECT
b. Exercise select.sql
c. INSERT
d. Exercise insert.sql
e. UPDATE
f. Exercise update.sql
g. DELETE
h. Exercise delete.sql
i. Condition WHERE
j. Exercise WhereClause.sql
k. Bulk bind
l. Exercise bulkDemo.sql
m. Clause RETURNING
n. Exercise ReturningInto.sql
o. Table reference
p. Database link
q. Synonims
3. Pseudo columns
a. CURRVAL и NEXTVAL
b. Exercise tables.sql
c. LEVEL
d. ROWID
e. ROWNUM
4. GRANT, REVOKE and privileges
a. Object and system privileges
b. GRANT and REVOKE
c. Roles
5. Transactions
a. COMMIT and ROLLBACK
b. Savepoints
c. Transactions and blocks
d. Autonomous transactions
e. Exercises autoTrans.sql, autoPragma.sql, autoSavepoints.sql

15. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 5), consulting
teacher, performing corresponding exercises from the book.

15. Internal SQL functions (2 hours)


1. Character functions
a. SUBSTR, SUBSTRB, SUBSTRC, SUBSTR2, SUBSTR4
b. SOUNDEX
c. INSTR, INSTRB, INSTRC, INSTR2, INSTR4
d. LENGTH, LENGTHS, LENGTHC, LENGTH2, LENGTH4
2. NLS functions
3. WIDTH.BUCKET
4. Arithmetic operations with date and time
5. Conversion functions
a. ТО_CHAR (date, time)
b. TO_CHAR (number)
c. ТО_DATE
d. ТО_NUMBER
e. ТО_TIMESTAMP, TIMESTAMP_TZ
6. DUMP
7. ISERENV

Day 5.

16. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 6), consulting
teacher, performing corresponding exercises from the book.

16. Advanced features of cursors (2 hours)


1. Implicit and explicit cursors
2. Exercises CursorLoop.sql, AlreadyOpen.sql, badFetch.sql, Parametrized.sql, Nomatch.sql,
NoDataFound.sql
3. Cursor cycles
4. Exercises SimpleLoop.sql, ExitWhen.sql, WhileLoop.sql, ForLoop.sql, ImplicitFOR.sql,
ForUpdate.sql, commit.sql

17. Cursor variables (1 hour)


1. Declaration of cursor variable
2. Exercise RefCursors.sql
3. Memory allocation
4. Opening cursor variable for query
5. Closing cursor variables
6. Exercises cursor1.sql, cursor2.sql
7. Restrictions for cursor variables
17. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 7), consulting
teacher, performing corresponding exercises from the book.

18. Advanced exception handling (5 hours)


1. Pragma EXCEPTION INIT
2. Exercise ExceptionInit.sql
3. Function RAISE_APPLICATION_ERROR
4. Exercises UserDefined.sql, Register.sql
5. Exceptions in execution block
6. Exceptions in declarations block
7. Exceptions in exceptions block
8. Scope of exception
9. Exercise OutOfScope.sql
10. Tracking all exceptions
11. Locating error
12. exercise ErrorPkg.sql

Day 6.

18. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 8), consulting
teacher, performing corresponding exercises from the book.

19. Composite constructions (5 hours)


1. Index-by tables
2. Exercise indexBy.sql
3. Nested tables
4. Exercises nested.sql, tConstruct.sql, nullTable.sql, tabAssign.sql
5. Varying arrays
6. Exercises varray.sql, Construct.sql, varAssign.sql, vAssign.sql
7. Multilevel constructions
8. Exercise multilevel.sql
9. Stored constructions
10. Exercises typeLocation.sql, tables.sql, collectionDML.sql, PrintRequired.sql, Library.sql,
callLibrary.sql, nonSequential.sql
11. Modification of composite constructions elements
12. Exercises Library.sql, callLibrary.sql, LibraryOperator.sql
13. Methods of composite constructions
14. Exercises exists.sql, count.sql, limit.sql, collectionLoops.sql, extend.sql, extendDelete.sql,
trim.sql, delete.sql

19. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 9), consulting
teacher, performing corresponding exercises from the book.

20. Additional features of procedures (3 hours)


1. Extended syntax of procedures and functions
2. Exercises AddNewStudent.sql, AlmostFull.sql, callFunction.sql, ClassInfo.sql, callANS.sql,
ModeTest.sql, callMT.sql, ParameterLength.sql, RaiseError.sql, NoCopyTest.sql, CopyFast.sql,
noparams.sql, CallMe.sql, default.sql, DefaultTest.sql, calls.sql

Day 7.

20. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 9), consulting
teacher, performing corresponding exercises from the book.

21. Additional features of packages (2 hours)


1. Extended syntax of package
2. Exercises ClassPackage.sql, packageError.sql, callCL.sql, ClassPackage2.sql
3. Overloading
4. Exercise overload.sql, objectOverload.sql
5. Instantiation
6. Exercise Random.sql

21. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 10), consulting
teacher, performing corresponding exercises from the book.

22. Advanced using of procedures (6 hours)


1. Allocation of procedures and functions
2. Exercises localSub.sql, localStored.sql, localError.sql, mutual.sql, forwardDeclaration.sql,
overloadedLocal.sql
3. Stored procedures
4. Exercises RecordFullClasses.sql, dependencies.sql, remoteDependencies.sql, PersistPkg.sql,
callRS.sql, PersistPkg2.sql, anonymousDependencies.sql, execute.sql, invokers.sql

Day 8.

22. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 10), consulting
teacher, performing corresponding exercises from the book.

23. Advanced using of procedures (continue) (2 hours)


1. Using of stored procedures
2. Exercises FullName.sql, StudentOps.sql, DefaultPragma.sql, Overload.sql, StudentsOps2.sql,
InsertTemp.sql, TrustPkg.sql, DMLUpdate.sql

23. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 11), consulting
teacher, performing corresponding exercises from the book.

24. Advanced using of triggers (6 hours)


1. Trigger types
2. Exercises relTables.sql, UpdateMajorStats.sql, insteadOf.sql, LogCeations.sql
3. Trigger creation
4. Exercises firingOrder.sql, GenerateStudentID.sql, pseudoRecords.sql, tables.sql,
LogRSChanges.sql, ClassesRoomInstead.sql, DatabaseSchema.sql, LogErrors.sql, samename.sql,
LogConnects.sql
5. Mutating tables
6. Exercise CascadeRSInsert.sql, LimitMajors.sql, mutating.sql

Day 9.

24. Self-study using S.Urman “Oracle 9i PL/SQL programming” (Chapter 12), consulting
teacher, performing corresponding exercises from the book.

25. Advanced features of PL/SQL (8 hours)


1. Native dynamic SQL
2. Exercises execImmediate.sql, execBind.sql, NativeDynamic.sql
3. Bulk collect
4. Exercises FORALL.sql, BULK_COLLECT.sql
5. Object types
6. Exercises Point.sql, PointSQL.sql
7. Large objects
8. Exercise LOB_DML.sql
9. Pipelined functions
10. Exercise pipelined.sql
11. Additional packages
a. DBMS_SQL, exercise dynamicDML.sql
b. DBMS_PIPE, exercises PipeSend.sql, PipeReceive.sql
c. DBMS_ALERT, exercises AlertSend.sql, AlertReceive.sql
d. UTL_FILE, exercise UTL_FILE.sql
e. UTL_TCP, exercise UTL_TCP.sql
f. DBMS_JOB, exercise DBMS_JOB.sql
g. DBMS_LOB, exercise DBMS_LOB.sql

Day 10.

25. Online training in MyLearning (Manipulating Large Objects in PL/SQL) - 2 hours.

26. Online training in MyLearning (Oracle-Supplied Packages and


DBMS_SCHEDULER) - 3 hours.

27. Online training in MyLearning (The SQL* Loader and PL/SQL) - 3 hours.

You might also like