MCT491 - Oracle Database 11g: Program with PL/SQL

Outline info
Semester
School
Last revision date 2017-11-21 11:05:36.074
Last review date 2017-11-21 11:05:50.877


Subject Title
Oracle Database 11g: Program with PL/SQL

Subject Description
Learn to create PL/SQL blocks of application code that can be shared by multiple forms, reports and data management applications and create anonymous PL/SQL blocks, stored procedures and functions. This course will help you prepare for the Oracle exam IZO-144.

Credit Status
 This subject is part of the Recognition of Achievement Programs for Oracle Application Developer.

Learning Outcomes
Upon successful completion of this subject the student will be able to:

1. Use conditional compilation to customize the functionality in a PL/SQL application without removing any source code.
2. Create and use stored procedures and functions.
3. Design and use PL/SQL packages to group and contain related constructs.
4. Create overloaded package subprograms for more flexibility.
5. Use the Oracle supplied PL/SQL packages to generate screen output, file output, and mail output.
6. Write dynamic SQL for more coding flexibility.
7. Describe the features and syntax of PL/SQL.
8. Use PL/SQL programming constructs and conditionally control code flow (loops, control structures, and explicit cursors).
9. Manage dependencies between PL/SQL subprograms.
10. Handle runtime errors.
11. Describe stored procedures and functions.
12. Design PL/SQL code for predefined data types, local subprograms, additional pragmas and standardized constants and exceptions.
13. Create triggers to solve business challenges.
14. Design PL/SQL anonymous block that execute efficiently.

Cheating and Plagiarism
Each student should be aware of the College's policy regarding Cheating and Plagiarism. Seneca's Academic Policy will be strictly enforced.

To support academic honesty at Seneca College, all work submitted by students may be reviewed for authenticity and originality, utilizing software tools and third party services. Please visit the Academic Honesty site on http://library.senecacollege.ca for further information regarding cheating and plagiarism policies and procedures.

Discrimination/Harassment
All students and employees have the right to study and work in an environment that is free from discrimination and/or harassment. Language or activities that defeat this objective violate the College Policy on Discrimination/Harassment and shall not be tolerated. Information and assistance are available from the Student Conduct Office at student.conduct@senecacollege.ca.

Accommodation for Students with Disabilities
The College will provide reasonable accommodation to students with disabilities in order to promote academic success. If you require accommodation, contact the Counselling and Disabilities Services Office at ext. 22900 to initiate the process for documenting, assessing and implementing your individual accommodation needs.

Prerequisite(s)
MCT490 or equivalent experience    

Topic Outline

Introduction

  • Course Objectives
  • Course Agenda
  • Describing the Human Resources (HR) Schema
  • PL/SQL Development Environments Available in this Course
  • Introduction to SQL Developer

 

Introduction to PL/SQL
  • PL/SQL Overview
  • Benefits of PL/SQL Subprograms
  • Overview of the Types of PL/SQL Blocks
  • Creating and Executing a Simple Anonymous Block
  • Generating Output from a PL/SQL Block

Declaring PL/SQL Identifiers
  • Different Types of Identifiers in a PL/SQL Subprogram
  • Using the Declarative Section to Define Identifiers
  • Storing Data in Variables
  • Scalar Data Types
  • %TYPE Attribute
  • Bind Variables
  • Using Sequences in PL/SQL Expressions

Writing Executable Statements
  • Describing Basic PL/SQL Block Syntax Guidelines
  • Commenting Code
  • SQL Functions in PL/SQL
  • Data Type Conversion
  • Nested Blocks
  • Operators in PL/SQL

Interacting with the Oracle Server
  • Including SELECT Statements in PL/SQL to Retrieve Data
  • Manipulating Data in the Server Using PL/SQL
  • The SQL Cursor Concept
  • Using SQL Cursor Attributes to Obtain Feedback on DML
  • Saving and Discarding Transactions

Writing Control Structures
  • Conditional Processing Using IF Statements
  • Conditional Processing Using CASE Statements
  • Simple Loop Statement
  • While Loop Statement
  • For Loop Statement
  • The Continue Statement

Working with Composite Data Types
  • Using PL/SQL Records
  • Using the %ROWTYPE Attribute
  • Inserting and Updating with PL/SQL Records
  • INDEX BY Tables
  • INDEX BY Table Methods
  • INDEX BY Table of Records

Using Explicit Cursors
  • Understanding Explicit Cursors
  • Declaring the Cursor
  • Opening the Cursor
  • Fetching Data from the Cursor
  • Closing the Cursor
  • Cursor FOR Loop
  • Explicit Cursor Attributes
  • FOR UPDATE Clause and WHERE CURRENT Clause

Handling Exceptions
  • Understanding Exceptions
  • Handling Exceptions with PL/SQL
  • Trapping Predefined Oracle Server Errors
  • Trapping Non-Predefined Oracle Server Errors
  • Trapping User-Defined Exceptions
  • Propagate Exceptions
  • RAISE_APPLICATION_ERROR Procedure

Creating Stored Procedures
  • Creating a Modularize and Layered Subprogram Design
  • Modularizing Development With PL/SQL Blocks
  • Understanding the PL/SQL Execution Environment
  • The Benefits of Using PL/SQL Subprograms
  • The Differences Between Anonymous Blocks and Subprograms
  • Creating, Calling, and Removing Stored Procedures Using the CREATE Command and SQL Developer
  • Using Procedures Parameters and Parameters Modes
  • Viewing Procedures Information Using the Data Dictionary Views and SQL Developer

Creating Stored Functions
  • Creating, Calling, and Removing a Stored Function Using the CREATE Command and SQL Developer
  • Identifying the Advantages of Using Stored Functions in SQL Statements
  • Identify the Steps to Create a Stored Function
  • Using User-Defined Functions in SQL Statements
  • Restrictions When Calling Functions from SQL Statements
  • Controlling Side Effects When Calling Functions from SQL Expressions
  • Viewing Functions Information

Creating Packages
  • Listing the Advantages of Packages
  • Describing Packages
  • The Components of a Package
  • Developing a Package
  • The Visibility of a Package’s Components
  • Creating the Package Specification and Body Using the SQL CREATE Statement and SQL Developer
  • Invoking the Package Constructs
  • Viewing the PL/SQL Source Code Using the Data Dictionary

Working With Packages
  • Overloading Subprograms in PL/SQL
  • Using the STANDARD Package
  • Using Forward Declarations to Solve Illegal Procedure Reference
  • Using Package Functions in SQL and Restrictions
  • Persistent State of Packages
  • Persistent State of a Package Cursor
  • Controlling Side Effects of PL/SQL Subprograms
  • Using PL/SQL Tables of Records in Packages

Using Oracle-Supplied Packages in Application Development
  • Using Oracle-Supplied Packages
  • Examples of Some of the Oracle-Supplied Packages
  • How Does the DBMS_OUTPUT Package Work?
  • Using the UTL_FILE Package to Interact With Operating System Files
  • Using the UTL_MAIL Package
  • Using the UTL_MAIL Subprograms

Using Dynamic SQL
  • The Execution Flow of SQL
  • What is Dynamic SQL?
  • Declaring Cursor Variables
  • Dynamically Executing a PL/SQL Block
  • Using Native Dynamic SQL to Compile PL/SQL Code
  • Using DBMS_SQL Package
  • Using DBMS_SQL with a Parameterized DML Statement
  • Dynamic SQL Functional Completeness

Design Considerations for PL/SQL Code
  • Standardizing Constants and Exceptions
  • Using Local Subprograms
  • Using Autonomous Transactions
  • Using the NOCOPY Compiler Hint
  • Using the PARALLEL_ENABLE Hint
  • Using the Cross-Session PL/SQL Function Result Cache
  • Using the DETERMINISTIC Clause with Functions
  • Using Bulk Binding to Improve Performance

Creating Triggers
  • Working With Triggers
  • Identifying the Trigger Event Types and Body
  • Business Application Scenarios for Implementing Triggers
  • Creating DML Triggers Using the CREATE TRIGGER Statement and SQL Developer
  • Identifying the Trigger Event Types, Body, and Firing (Timing)
  • Statement Level Triggers Versus Row Level Triggers
  • Creating Instead of and Disabled Triggers
  • Managing, Testing, and Removing Triggers

Creating Compound, DDL, and Event Database Triggers
  • Working With Compound Triggers
  • Identifying the Timing-Point Sections of a Table Compound Trigger
  • Compound Trigger Structure for Tables and Views
  • Using a Compound Trigger to Resolve the Mutating Table Error
  • Comparing Database Triggers to Stored Procedures
  • Creating Triggers on DDL Statements
  • Creating Database-Event and System-Events Triggers
  • System Privileges Required to Manage Triggers

Using the PL/SQL Compiler
  • Using the PL/SQL Compiler
  • Using the Initialization Parameters for PL/SQL Compilation
  • Using the New PL/SQL Compile Time Warnings
  • Overview of PL/SQL Compile Time Warnings for Subprograms
  • The Benefits of Compiler Warnings
  • The PL/SQL Compile Time Warning Messages Categories
  • Setting the Warning Messages Levels: Using SQL Developer, PLSQL_WARNINGS Initialization Parameter, and the DBMS_WARNING Package Subprograms
  • Viewing the Compiler Warnings: Using SQL Developer, SQL*Plus, or the Data Dictionary Views

Managing PL/SQL Code
  • What Is Conditional Compilation and How Does it Work?
  • Using Selection Directives
  • Using Predefined and User-Defined Inquiry Directives
  • The PLSQL_CCFLAGS Parameter and the Inquiry Directive
  • Using Conditional Compilation Error Directives to Raise User-Defined Errors
  • Using the DBMS_DB_VERSION Package
  • Using DBMS_PREPROCESSOR Procedures to Print or Retrieve Source Text
  • Obfuscating and Wrapping PL/SQL Code

Managing Dependencies
  • Overview of Schema Object Dependencies
  • Querying Direct Object Dependencies Using the USER_DEPENDENCIES View
  • Querying an Object’s Status
  • Invalidation of Dependent Objects
  • Displaying Direct and Indirect Dependencies
  • Fine-Grained Dependency Management in Oracle Database 11g
  • Understanding Remote Dependencies
  • Recompiling a PL/SQL Program Unit

Mode of Instruction
The primary mode of learning will be a combination of lecture and hands-on classroom instruction. Additional modes of instruction will include class discussion, and question and answer period.

Prescribed Texts
The following materials will be provided:
Oracle's ebook 

Required Supplies
USB Flash Drive

Promotion Policy

Grading Policy
A+ 90%  to  100%
A 80%  to  89%
B+ 75%  to  79%
B 70%  to  74%
C+ 65%  to  69%
C 60%  to  64%
D+ 55%  to  59%
D 50%  to  54%
F 0%    to  49% (Not a Pass)
OR
EXC Excellent
SAT Satisfactory
UNSAT Unsatisfactory

For further information, see a copy of the Academic Policy, available online (http://www.senecacollege.ca/academic-policy) or at Seneca's Registrar's Offices.


Modes of Evaluation
This subject is part of the Oracle Application Developer program.  Those students choosing to pursue their Oracle Application Developer Recognition of Achievement are required to write a final exam at the completion of this subject. A mark of 70% of higher is required in the exam in order to apply this subject to the Recognition of Achievement.  

Approved by: Denis Gravelle