Sie sind auf Seite 1von 105

This document is...

UsefulNot useful

Search

Upload

enChange Language

Learn more about Scribd Membership

Home

Saved

Bestsellers

Books

Audiobooks

Snapshots

Magazines

Documents

Sheet Music

Jump to Page
1

You are on page 1of 398

Search inside document


766 views

Oracle 11g Advanced PL-SQL


Uploaded by
loafer555

Date uploaded

on Jun 19, 2015

Description:
Student Guide

Full description

Related titles
Carousel Next

SQL Fundaments


Oracle Database 11g Advanced PLSQL

Oracle Database 11g Develop PLSQL Program Unit Student Guide . Volume 2 2007.Unlocked


Oracle11g Advance Plsql Student Guide

Oracle Database 11g, PL SQL Fundamentals, Student Guide

Oracle Database 11g - SQL - Fundamentals 1 - Volume 2 - Student Guide

Oracle Database 11g PL SQL Fundamentals Unlocked


Oracle Database 11g - SQL Fundamentals I Vol3

Oracle Database SQL Fundamentals I - Practice

Oracle 12c Performance Tuning

Oracle Database 11g SQL Fundamentals I (Vol2).pdf

2- Oracle Database 11g SQL 2- Oracle Database 11g SQL Fundamentals i Vol 2Fundamentals i Vol
2


Oracle Fusion Middleware 11g Java Programming Student Guide Volume I

11g SQL Tuning Workshop - Volume 2

D59428.pdf

Oracle Database 11g - SQL Fundamentals II Vol2

Oracle Fusion Middleware 11g Java Programming Student Guide Volume II


Oracle Database 11g - SQL Fundamentals I Vol2

Oracle Database SQL Fundamentals II.pdf

Oracle Database 11g SQL Tuning Workshop.pdf

Jump to Page
1

You are on page 1of 398

Search inside document


Oracle
Database 11
g
: Advanced
PL/SQL
Volume I

Student Guide
D52601GC10Edition
1.0March
2008D54299
Copyright © 2008,Oracle.
All rights
reserved.Disclaimer
This document contains
proprietary information
and is protected by
copyright and other
intellectual property laws.
You may copy and print
this document solely for
your own use in an Oracle
training course. The
document may not be
modified or altered in any
way. Except where your
use constitutes "fair use"
under copyright law, you
may not use, share,
download, upload, copy,
print, display,
perform,reproduce,
publish, license, post,
transmit, or distribute this
document in whole orin
part without the express
authorization of
Oracle.The information
contained in this document
is subject to change
without notice. If you find
any problems in the
document, please report
them in writingto: Oracle
University, 500 Oracle
Parkway, Redwood Shores,
California 94065 USA. This
document is not warranted
to be error-free.
Restricted Rights Notice
If this documentation is
delivered to the United
States Government or
anyone using the
documentation on behalf
of the United States
Government, thefollowing
notice is applicable: U.S.
GOVERNMENT RIGHTSThe
U.S. Government’s rights
to use, modify, reproduce,
release, perform, display,
or disclose these training
materials are restricted by
the terms ofthe applicable
Oracle license agreement
and/or the applicable U.S.
Government contract.
Trademark Notice
Oracle is a registered
trademark of Oracle
Corporation and/or its
affiliates. Other names
may be trademarks of their
respective owners.
Authors
Nancy GreenbergRick
GreenMarcie Young
Technical
Contributors and
Reviewers
Claire BennettTom
BestTammy
BradleyYantiChangKe
n Cooper Laszlo
CzinkoczkiDavid Jacob-
DaubFrancesco
FerlaMark FlemingClay
Fuller Laura GarzaYash
JainBryn
LlewelynTimothy
McGlueEssi
Parast Nagavalli
PataballaAlan
PaulsonChaya
RaoHelen Robertson
Lauran SerhalClinton
Shaffer Jenny
TsaiMichael Versaci
Ted Witiuk
Editors
Vijayalakshmi
NarasimhanSusan
Moxley
Graphic Designer
Steve Elwood
Publishers
Sujatha NagendraJobi
Varghese
iii
Contents
Preface 1
Introduction
Course Objectives
1-2 Oracle
Complete Solution
1-3 Lesson Agenda
1-4 Course Agenda
1-5 Lesson Agenda
1-7 Development
Environments:
Overview 1-8
Lesson Agenda 1-9
What Is Oracle SQL
Developer? 1-10
Starting SQL
Developer and
Creating a Database
Connection 1-11
Creating Schema
Objects 1-12 Using
the SQL Worksheet
1-13 Executing SQL
Statements 1-15
Executing Saved
Script Files: Method
1 1-16 Executing
Saved SQL Scripts:
Method 2 1-17
Creating an
Anonymous Block
1-18 Editing the
PL/SQL Code 1-19
Saving SQL Scripts
1-20 Debugging
Procedures and
Functions 1-21
Lesson Agenda 1-22
Using SQL*Plus 1-
23 Coding PL/SQL in
SQL*Plus 1-24
Lesson Agenda 1-25
Tables Used in This
Course 1-26 The
Order Entry Schema
1-27 The Human
Resources Schema
1-29 Summary 1-30
Practice 1
Overview: Getting
Started 1-31
2 PL/SQL
Programming
Concepts: Review
Objectives 2-2
Lesson Agenda 2-3
PL/SQL Block
Structure 2-4
iv
Naming
Conventions 2-5
Procedures 2-6
Procedure: Example
2-7 Functions 2-8
Function: Example
2-9 Ways to
Execute Functions
2-10 Lesson Agenda
2-11 Restrictions on
Calling Functions
from SQL
Expressions 2-12
Lesson Agenda 2-14
PL/SQL Packages:
Review 2-15
Components of a
PL/SQL Package 2-
16 Creating the
Package
Specification 2-17
Creating the
Package Body 2-18
Lesson Agenda 2-19
Cursor 2-20
Processing Explicit
Cursors 2-22
Explicit Cursor
Attributes 2-23
Cursor
FOR
Loops 2-24 Cursor:
Example 2-25
Lesson Agenda 2-26
Handling Exceptions
2-27 Exceptions:
Example 2-29
Predefined Oracle
Server Errors 2-30
Trapping Non-
Predefined Oracle
Server Errors 2-33
Trapping User-
Defined Exceptions
2-34 Lesson Agenda
2-35 The
RAISE_APPLICATIO
N_ERROR
Procedure 2-36
Lesson Agenda 2-38
Dependencies 2-39
Displaying Direct
and Indirect
Dependencies 2-41
Lesson Agenda 2-42
Using Oracle-
Supplied Packages
2-43 Some of the
Oracle-Supplied
Packages 2-44
DBMS_OUTPUT
Package 2-45
UTL_FILE
Package 2-46
Summary 2-47
Practice 2:
Overview 2-48
v
3 Designing PL/SQL
Code
Objectives 3-2
Lesson Agenda 3-3
Guidelines for
Cursor Design 3-4
Lesson Agenda 3-9
Cursor Variables:
Overview 3-10
Working with
Cursor Variables 3-
11 Strong Versus
Weak
REF CURSOR
Variables 3-12 Step
1: Defining a
REF CURSOR
Type 3-13 Step 1:
Declaring a Cursor
Variable 3-14 Step
1: Declaring a
REF CURSOR
Return Type 3-15
Step 2: Opening a
Cursor Variable 3-
16 Step 3: Fetching
from a Cursor
Variable 3-18 Step
4: Closing a Cursor
Variable 3-19
Passing Cursor
Variables as
Arguments 3-20
Using the
Predefined Type
SYS_REFCURSOR
3-23 Rules for
Cursor Variables 3-
25 Comparing
Cursor Variables
with Static Cursors
3-26 Lesson Agenda
3-27 Predefined
PL/SQL Data Types
3-28 Subtypes:
Overview 3-29
Benefits of
Subtypes 3-31
Declaring Subtypes
3-32 Using
Subtypes 3-33
Subtype
Compatibility 3-34
Summary 3-35
Practice 3:
Overview 3-36
4 Working with
Collections
Objectives 4-2
Lesson Agenda 4-3
Understanding
Collections 4-4
Collection Types 4-5
Lesson Agenda 4-7
Using Associative
Arrays 4-8 Creating
the Array 4-9
Populating the
Array 4-10 Lesson
Agenda 4-12 Using
Nested Tables 4-13
Nested Table
Storage 4-14
vi
Creating Nested
Tables 4-15
Declaring
Collections: Nested
Table 4-16 Using
Nested Tables 4-17
Referencing
Collection Elements
4-19 Using Nested
Tables in PL/SQL 4-
20 Lesson Agenda
4-22 Understanding
Varrays 4-23
Declaring
Collections: Varray
4-24 Using Varrays
4-25 Lesson Agenda
4-27 Working with
Collections in
PL/SQL 4-28
Initializing
Collections 4-31
Referencing
Collection Elements
4-33 Using
Collection Methods
4-34 Manipulating
Individual Elements
4-38 Lesson Agenda
4-40 Avoiding
Collection
Exceptions 4-
41 Avoiding
Collection
Exceptions:
Example 4-42
Lesson Agenda 4-43
Listing
Characteristics for
Collections 4-44
Guidelines for Using
Collections
Effectively 4-45
Summary 4-46
Practice 4:
Overview 4-47
5 Using Advanced
Interface Methods
Objectives 5-2
Calling External
Procedures from
PL/SQL 5-3 Benefits
of External
Procedures 5-4
External C
Procedure
Components 5-5
How PL/SQL Calls a
C External
Procedure 5-6 The
extproc
Process 5-7 The
Listener Process 5-8
Development Steps
for External C
Procedures 5-9 The
Call Specification 5-
13 Publishing an
External C Routine
5-16 Executing the
External Procedure
5-17 Java: Overview
5-18 Calling a Java
Class Method by
Using PL/SQL 5-19
Development Steps
for Java Class
Methods 5-20
Loading Java Class
Methods 5-21
Publishing a Java
Class Method 5-22
vii
Executing the Java
Routine 5-24
Creating Packages
for Java Class
Methods 5-25
Summary 5-26
Practice 5:
Overview 5-27
6 Implementing
Fine-Grained Access
Control for VPD
Objectives 6-2
Lesson Agenda 6-3
Fine-Grained Access
Control: Overview
6-4 Identifying Fine-
Grained Access
Features 6-5 How
Fine-Grained Access
Works 6-6 Why Use
Fine-Grained
Access? 6-8 Lesson
Agenda 6-9 Using
an Application
Context 6-10
Creating an
Application Context
6-12 Setting a
Context 6-13
Implementing a
Policy 6-15 Step 2:
Creating the
Package 6-16 Step
3: Defining the
Policy 6-18 Step 4:
Setting Up a Logon
Trigger 6-21
Example Results 6-
22 Data Dictionary
Views 6-23 Using
the
ALL_CONTEXT
Dictionary View 6-
24 Policy Groups 6-
25 More About
Policies 6-26
Summary 6-28
Practice 6:
Overview 6-29
7 Manipulating
Large Objects
Objectives 7-2
Lesson Agenda 7-3
What Is a
LOB
? 7-4 Contrasting
LONG
and
LOB
Data Types 7-6
Components of a
LOB
7-7 Internal
LOB
s 7-8 Managing
Internal
LOB
s 7-9 Lesson
Agenda 7-10 What
Are
BFILE
s? 7-11 Securing
BFILE
s 7-12 What Is a
DIRECTORY
? 7-13
You're reading a previewUnlock full access (pages 8-24) by
uploading documents or with a 30 Day Free Trial
You're reading a previewUnlock full access (pages 32-36) by
uploading documents or with a 30 Day Free Trial
You're reading a previewUnlock full access (pages 44-133)
by uploading documents or with a 30 Day Free Trial
You're reading a previewUnlock full access (pages 141-196)
by uploading documents or with a 30 Day Free Trial
You're reading a previewUnlock full access (pages 204-398)
by uploading documents or with a 30 Day Free Trial
Reward Your Curiosity
Everything you want to read.

Anytime. Anywhere. Any device.

Read Free For 30 Days

No Commitment. Cancel anytime.

Share this document


Share or Embed Document

Sharing Options
 Share on Facebook, opens a new window
 Share on Twitter, opens a new window
 Share on LinkedIn, opens a new window
 Share with Email, opens mail client
 Copy Text
Related Interests
 Pl/Sql
 Oracle Database
 Sql
 Java (Programming Language)
 Web Application

Documents Similar To Oracle 11g Advanced PL-SQL


Carousel Next

SQL Fundaments

Uploaded by

MaoArmada

Oracle Database 11g Advanced PLSQL

Uploaded by

SSP226

Oracle Database 11g Develop PLSQL Program Unit Student Guide . Volume 2 2007.Unlocked

Uploaded by

Niyatee Patil

Oracle11g Advance Plsql Student Guide

Uploaded by

Neeraj Rathore

Oracle Database 11g, PL SQL Fundamentals, Student Guide

Uploaded by
jsantosr2001

Oracle Database 11g - SQL - Fundamentals 1 - Volume 2 - Student Guide

Uploaded by

Rumaiya Afreen

Oracle Database 11g PL SQL Fundamentals Unlocked

Uploaded by

Mohamed El-Tokhy


Oracle Database 11g - SQL Fundamentals I Vol3

Uploaded by

ralucap

Oracle Database SQL Fundamentals I - Practice

Uploaded by

AbdurRahman

Oracle 12c Performance Tuning

Uploaded by

darelaw10

Oracle Database 11g SQL Fundamentals I (Vol2).pdf

Uploaded by

piciul2010

2- Oracle Database 11g SQL 2- Oracle Database 11g SQL Fundamentals i Vol 2Fundamentals i Vol
2

Uploaded by

Navya Sai Krishna B

Oracle Fusion Middleware 11g Java Programming Student Guide Volume I

Uploaded by
ksknrindian

11g SQL Tuning Workshop - Volume 2

Uploaded by

Alex Dumitriu

D59428.pdf

Uploaded by

Mohamedou Matar Seck


Oracle Database 11g - SQL Fundamentals II Vol2

Uploaded by

ralucap

Oracle Fusion Middleware 11g Java Programming Student Guide Volume II

Uploaded by

ksknrindian

Oracle Database 11g - SQL Fundamentals I Vol2

Uploaded by

ralucap

Oracle Database SQL Fundamentals II.pdf

Uploaded by

francdy

Oracle Database 11g SQL Tuning Workshop.pdf

Uploaded by

juanarru

Oracle Database 11g BI and Data Warehousing D52358

Uploaded by
exodee

11g SQL FUNDAMENTALS II ADDITIONAL PRACTICES AND SOLUTIONS

Uploaded by

Jawad Ahmed

Oracle Database 11g SQL Tuning Workshop - Student Guide.pdf

Uploaded by

ekutamahufa9208


Oracle 11g SQL Fundamentals II

Uploaded by

chennam1

Oracle Database 12c: SQL Workshop I - Activity Guide

Uploaded by

Perico Palotes

PL-SQL+Exercices+on+Chapter+9+ Procedures+and+Functions

Uploaded by

Ntaoleng Leah Mofukunyane


student_guide_2.pdf

Uploaded by

Hari Prasath

Oracle Database 11g Develop PLSQL Program Unit Student Guide . Volume 2 2007

Uploaded by

heli1975

Advanced PLSQL (Vol 1)

Uploaded by
binkozi

PL SQL Notes Only

Uploaded by

writesmd

More From loafer555


OFDM System Based on Dual Tree Complex Wavelet Transform (DT-CWT)

Uploaded by

loafer555


Data Mining - Association Analysis

Uploaded by

loafer555

Mcsa SQL Server 2012

Uploaded by

loafer555

Matlab Real-time Trading Presentation

Uploaded by

loafer555

TEWA50 - BW Query Tuning

Uploaded by

loafer555

Footer Menu
Back To Top

About

 About Scribd
 Press
 Our blog
 Join our team!
 Contact Us
 Invite Friends
 Gifts

Support

 Help / FAQ
 Accessibility
 Purchase help
 AdChoices
 Publishers

Legal

 Terms
 Privacy
 Copyright

Social Media


o
o
o
o

 Copyright © 2019 Scribd Inc.


 Browse Books
 Site Directory
 Site Language:

EnglishChange Language

Related titles
Carousel Next

SQL Fundaments

Oracle Database 11g Advanced PLSQL


Oracle Database 11g Develop PLSQL Program Unit Student Guide . Volume 2 2007.Unlocked

Oracle11g Advance Plsql Student Guide

Oracle Database 11g, PL SQL Fundamentals, Student Guide

Oracle Database 11g - SQL - Fundamentals 1 - Volume 2 - Student Guide

Oracle Database 11g PL SQL Fundamentals Unlocked


Oracle Database 11g - SQL Fundamentals I Vol3

Oracle Database SQL Fundamentals I - Practice

Oracle 12c Performance Tuning

Oracle Database 11g SQL Fundamentals I (Vol2).pdf

2- Oracle Database 11g SQL 2- Oracle Database 11g SQL Fundamentals i Vol 2Fundamentals i Vol
2

Das könnte Ihnen auch gefallen