Basic PLSQL Programming


Course Description:

This class is applicable to Oracle8i, Oracle9i and Oracle Database 10g users.

This course introduces students to PL/SQL and helps them understand the benefits of this powerful programming language. In the class, students learn to create PL/SQL blocks of application code that can be shared by multiple forms, reports, and data management applications.

Students learn to create anonymous PL/SQL blocks, stored procedures, and functions. They learn about declaring variables and trapping exceptions. Students will also learn to develop stored procedures, functions, packages and database triggers. Students will learn to manage PL/SQL program units manage dependencies, manipulate large objects, and use some of the Oracle-supplied packages. Students use iSQL*Plus to develop these program units. Demonstrations and hands-on practice reinforce the fundamental concepts.

This course counts towards the Hands-on course requirement for the Oracle Database 10g Administrator Certification. Only instructor-led inclass or instructor-led online formats of this course will meet the Certification Hands-on Requirement. Self Study CD-Rom and Knowledge Center courses DO NOT meet the Hands-on Requirement.

PL/SQL Developer
Database Designers
Forms Developer
Technical Consultant

Course Objectives:

Design PL/SQL anonymous blocks that execute efficiently
Write PL/SQL code to interface with the database
Describe the features and syntax of PL/SQL
Use PL/SQL programming constructs and conditionally control code flow (loops, control structures, and explicit cursors)
Handle runtime errors
Create simple procedures and functions
Design PL/SQL packages to group and contain related constructs
Categorize and Use the Oracle supplied PL/SQL packages to generate screen output, file output, web output, and mail output
Schedule PL/SQL jobs to run independently
Write dynamic SQL for more coding flexibility
Create triggers to solve business challenges
Manage dependencies between PL/SQL subprograms

This course includes classroom labs for live hands-on training

Course Duration: 2 days

Course Code:

Course Description: This course is designed to introduce Oracle DBAs, software development personnel and database support staff to the primary features and constructs of the PL/SQL Programming Language and enhance their productivity in manipulating data.

The delegates will practise:

    * Writing and running PL/SQL programs from SQL*Plus or SQL Developer
    * Declaring and using variables and constants
    * Assigning and manipulating values
    * Using SQL statements within PL/SQL
    * Implementing conditional execution and loop constructs
    * Declaring and using cursors with and without parameters
    * Updating data with cursors
    * Trapping and handling errors and exceptions in code
    * Implementing nested and labelled loops and blocks
    * Raising exceptions
    * Handling PL/SQL records and tables
    * Using PL/SQL table built-in functions

Prerequisites :  A working knowledge of SQL*Plus. This can be gained by attendance on SQL*Plus (OSP). Some previous programming experience would prove advantageous.

Prerequisite Courses Oracle SQL


PL/SQL Fundamentals

    * What is PL/SQL?
    * Basic Elements
    * Variables and Constants
    * Data Types
    * Initialising Variables and Assigning Values
    * Using SQL Statements in Code
    * Generating Output to SQL or SQL Developer

Program Logic

    * IF THEN ELSIF ELSE Statements
    * CASE Statements
    * The Basic Loop Construct
    * WHILE and FOR Loops
    * Nested and Labelled Loops
    * The GOTO Statement
    * The CONTINUE Statement

Using Cursors

    * What is a Cursor?
    * Implicit and Explicit Cursors
    * Cursor Operations
    * Declaring, Opening and Closing Cursors
    * Fetching Rows
    * Status Checking
    * Using Cursors FOR UPDATE
    * The Cursor FOR Loop
    * Parameterised Cursors

Exceptions and Nested Blocks

    * The EXCEPTION Section
    * Types of Exception
    * Handling Named System-Raised Exceptions
    * Handling Un-named System-Raised Exceptions
    * User-Declared Exceptions and Application Errors
    * Nested and Labelled Blocks
    * Propagation of Exceptions
    * Scope of Variables and Cursors
    * Scope of Goto Statements

PL/SQL Records and Index-By Tables

    * Declaring Record Types
    * Handling PL/SQL Records
    * Nested Records
    * Declaring PL/SQL Index-By Tables or Associative Arrays
    * PL/SQL Table Built-in Functions
    * Manipulating PL/SQL Tables or Associative Arrays