Tutorial Downloads .com

Home

Oracle 10g Database PL/SQL User's Guide and Reference study material - pdf tutorial

Anyone developing PL/SQL-based applications for Oracle should read this book. This book is intended for programmers, systems analysts, project managers, database administrators, and others who need to automate database operations. People developing applications in other languages can also produce mixed-language applications with parts written in PL/SQL.

To use this guide effectively, you need a working knowledge of the Oracle database, the SQL language, and basic programming constructs such as IF-THEN comparisons, loops, procedures, and functions.

Contents of this Oracle 10g Database PL/SQL User's Guide and Reference study material - pdf tutorial

1 Overview of PL/SQL
Advantages of PL/SQL ................ 1-1
Tight Integration with SQL... 1-2
Better Performance................ 1-2
Higher Productivity.............. 1-3
Full Portability ....................... 1-3
Tight Security......................... 1-3
Access to Pre-defined Packages ...................... 1-4
Support for Object-Oriented Programming.. 1-4
Support for Developing Web Applications and Pages........... 1-4
Understanding the Main Features of PL/SQL ... 1-4
Understanding PL/SQL Block Structure....... 1-4
Understanding PL/SQL Variables and Constants.................. 1-5
Declaring Variables......... 1-5
Assigning Values to a Variable ................ 1-6
Bind Variables ................. 1-7
Declaring Constants........ 1-7
Processing Queries with PL/SQL................... 1-8
Declaring PL/SQL Subprograms.................... 1-8
Declaring Datatypes for PL/SQL Variables.. 1-8
%TYPE.. 1-8
%ROWTYPE ................... 1-9
Understanding PL/SQL Control Structures . 1-9
Conditional Control..... 1-10
Iterative Control ........... 1-10
Sequential Control ....... 1-12
Understanding Conditional Compilation .. 1-12
Writing Reusable PL/SQL Code.................. 1-13
Subprograms: Procedures and Functions ...................... 1-13
Packages: APIs Written in PL/SQL...... 1-13
Inputting and Outputting Data with PL/SQL...................... 1-15
Understanding PL/SQL Data Abstraction. 1-16
Cursors ......................... 1-16
Collections.................... 1-16
Records ......................... 1-16
Object Types ................. 1-17
Understanding PL/SQL Error Handling ... 1-18
PL/SQL Architecture................ 1-18
In the Oracle Database Server ...................... 1-19
Anonymous Blocks ...... 1-19
Stored Subprograms.... 1-19
Database Triggers ........ 1-20
In Oracle Tools.................... 1-21
2 Fundamentals of the PL/SQL Language
Character Sets and Lexical Units .......................... 2-1
Delimiters .... 2-2
Identifiers .... 2-3
Reserved Words .............. 2-4
Predefined Identifiers..... 2-4
Quoted Identifiers.......... 2-4
Literals ......... 2-4
Numeric Literals............. 2-5
Character Literals........... 2-6
String Literals.................. 2-6
BOOLEAN Literals ......... 2-7
Datetime Literals ............. 2-7
Comments ... 2-7
Single-Line Comments ... 2-7
Multi-line Comments ..... 2-8
Restrictions on Comments........................ 2-8
Declarations....... 2-8
Constants ..... 2-9
Using DEFAULT ................... 2-9
Using NOT NULL................. 2-9
Using the %TYPE Attribute.......................... 2-10
Using the %ROWTYPE Attribute ................ 2-11
Aggregate Assignment 2-12
Using Aliases ................ 2-12
Restrictions on Declarations ......................... 2-13
PL/SQL Naming Conventions† 2-13
Scope and Visibility of PL/SQL Identifiers .... 2-15
Assigning Values to Variables† 2-18
Assigning BOOLEAN Values....................... 2-19
Assigning a SQL Query Result to a PL/SQL Variable ........ 2-19
PL/SQL Expressions and Comparisons............ 2-19
Logical Operators............... 2-20
Order of Evaluation ..... 2-21
Short-Circuit Evaluation ........................ 2-21
Comparison Operators 2-22
Relational Operators.... 2-22
IS NULL Operator........ 2-23
LIKE Operator .............. 2-23
BETWEEN Operator.... 2-23
IN Operator.................. 2-23
Concatenation Operator......................... 2-23
BOOLEAN Expressions ..... 2-24
BOOLEAN Arithmetic Expressions ..... 2-24
BOOLEAN Character Expressions....... 2-24
BOOLEAN Date Expressions................ 2-25
Guidelines for PL/SQL BOOLEAN Expressions.......... 2-25
CASE Expressions.............. 2-26
Simple CASE expression........................ 2-26
Searched CASE Expression ................... 2-27
Handling Null Values in Comparisons and Conditional Statements .......... 2-27
NULLs and the NOT Operator ............. 2-28
Conditional Compilation........ 2-30
How Does Conditional Compilation Work?......................... 2-31
Conditional Compilation Control Tokens...................... 2-31
Using Conditional Compilation Selection Directives... 2-31
Using Conditional Compilation Error Directives ......... 2-31
Using Conditional Compilation Inquiry Directives ..... 2-31
Using Predefined Inquiry Directives With Conditional Compilation . 2-32
Using Static Expressions with Conditional Compilation........................ 2-33
Setting the PLSQL_CCFLAGS Initialization Parameter.......................... 2-34
Using DBMS_DB_VERSION Package Constants.......... 2-35
Conditional Compilation Examples ............ 2-35
Using Conditional Compilation to Specify Code for Database Versions ........................ 2-35
Using DBMS_PREPROCESSOR Procedures to Print or Retrieve Source Text ............... 2-36
Conditional Compilation Restrictions......... 2-37
Using PL/SQL to Create Web Applications and Server Pages 2-38
PL/SQL Web Applications 2-38
PL/SQL Server Pages ......... 2-38
Summary of PL/SQL Built-In Functions.......... 2-38
3 PL/SQL Datatypes
Overview of Predefined PL/SQL Datatypes ...... 3-1
PL/SQL Number Types ........ 3-2
BINARY_INTEGER Datatype.................. 3-2
BINARY_FLOAT and BINARY_DOUBLE Datatypes..... 3-2
NUMBER Datatype ........ 3-3
PLS_INTEGER Datatype 3-4
PL/SQL Character and String Types ............. 3-4
CHAR Datatype ............. 3-4
LONG and LONG RAW Datatypes........ 3-5
RAW Datatype ................ 3-6
ROWID and UROWID Datatype............. 3-6
VARCHAR2 Datatype.... 3-8
PL/SQL National Character Types ................ 3-9
Comparing UTF8 and AL16UTF16 Encodings................. 3-9
NCHAR Datatype........... 3-9
NVARCHAR2 Datatype ........................ 3-10
PL/SQL LOB Types............ 3-10
BFILE Datatype ............ 3-11
BLOB Datatype............ 3-11
CLOB Datatype ............ 3-11
NCLOB Datatype ......... 3-12
PL/SQL Boolean Types...... 3-12
BOOLEAN Datatype ... 3-12
PL/SQL Date, Time, and Interval Types .... 3-12
DATE Datatype ............ 3-13
TIMESTAMP Datatype .......................... 3-13
TIMESTAMP WITH TIME ZONE Datatype.................. 3-14
TIMESTAMP WITH LOCAL TIME ZONE Datatype... 3-15
INTERVAL YEAR TO MONTH Datatype..................... 3-16
INTERVAL DAY TO SECOND Datatype ...................... 3-16
Datetime and Interval Arithmetic................ 3-17
Avoiding Truncation Problems Using Date and Time Subtypes.................. 3-17
Overview of PL/SQL Subtypes.......................... 3-17
Defining Subtypes .............. 3-18
Using Subtypes................... 3-18
Type Compatibility With Subtypes...... 3-19
Constraints and Default Values With Subtypes............ 3-20
Converting PL/SQL Datatypes .......................... 3-21
Explicit Conversion............ 3-21
Implicit Conversion ............ 3-21
Choosing Between Implicit and Explicit Conversion .......... 3-23
DATE Values ...................... 3-23
RAW and LONG RAW Values .................... 3-23
Differences between the CHAR and VARCHAR2 Datatypes 3-23
Assigning Character Values ......................... 3-23
Comparing Character Values ....................... 3-24
Inserting Character Values† 3-25
Selecting Character Values† 3-26
4 Using PL/SQL Control Structures
Overview of PL/SQL Control Structures ............ 4-1
Testing Conditions: IF and CASE Statements ... 4-2
Using the IF-THEN Statement ........................ 4-2
Using the IF-THEN-ELSE Statement.............. 4-2
Using the IF-THEN-ELSIF Statement............. 4-3
Using CASE Statements ........ 4-4
Searched CASE Statement ........................ 4-5
Guidelines for PL/SQL Conditional Statements..................... 4-6
Controlling Loop Iterations: LOOP and EXIT Statements......... 4-7
Using the LOOP Statement... 4-7
Using the EXIT Statement ..... 4-7
Using the EXIT-WHEN Statement.................. 4-8
Labeling a PL/SQL Loop ...... 4-8
Using the WHILE-LOOP Statement............... 4-9
Using the FOR-LOOP Statement .................... 4-9
How PL/SQL Loops Iterate .................. 4-10
Dynamic Ranges for Loop Bounds....... 4-11
Scope of the Loop Counter Variable .... 4-11
Using the EXIT Statement in a FOR Loop...................... 4-12
Sequential Control: GOTO and NULL Statements .................. 4-13
Using the GOTO Statement .......................... 4-13
Restrictions on the GOTO Statement ... 4-15
Using the NULL Statement 4-15
5 Using PL/SQL Collections and Records
What are PL/SQL Collections and Records? ...... 5-1
Understanding PL/SQL Collections .............. 5-2
Understanding Nested Tables.................. 5-2
Understanding Varrays.. 5-3
Understanding Associative Arrays (Index-By Tables).... 5-3
How Globalization Settings Affect VARCHAR2 Keys for Associative Arrays ................. 5-4
Understanding PL/SQL Records.................... 5-5
Choosing Which PL/SQL Collection Types to Use...................... 5-5
Choosing Between Nested Tables and Associative Arrays ... 5-5
Choosing Between Nested Tables and Varrays....................... 5-5
Defining Collection Types and Declaring Collection Variables.......................... 5-6
Declaring PL/SQL Collection Variables........ 5-7
Initializing and Referencing Collections ........ 5-10
Referencing Collection Elements ................. 5-11
Assigning Collections.............. 5-12
Comparing Collections............ 5-16
Using Multilevel Collections .. 5-18
Using Collection Methods....... 5-19
Checking If a Collection Element Exists (EXISTS Method)† 5-19
Counting the Elements in a Collection (COUNT Method) . 5-20
Checking the Maximum Size of a Collection (LIMIT Method) ..................... 5-20
Finding the First or Last Collection Element (FIRST and LAST Methods) . 5-21
Looping Through Collection Elements (PRIOR and NEXT Methods)......... 5-22
Increasing the Size of a Collection (EXTEND Method) ....... 5-23
Decreasing the Size of a Collection (TRIM Method)............ 5-24
Deleting Collection Elements (DELETE Method) ................ 5-25
Applying Methods to Collection Parameters........................ 5-26
Avoiding Collection Exceptions ........................ 5-27
Defining and Declaring Records....................... 5-29
Using Records as Procedure Parameters and Function Return Values ....... 5-31
Assigning Values to Records... 5-32
Comparing Records ............ 5-33
Inserting PL/SQL Records into the Database....................... 5-33
Updating the Database with PL/SQL Record Values ......... 5-34
Restrictions on Record Inserts and Updates ......................... 5-35
Querying Data into Collections of Records 5-36
6 Performing SQL Operations from PL/SQL
Overview of SQL Support in PL/SQL................. 6-1
Data Manipulation ................. 6-1
Transaction Control ............... 6-3
SQL Functions........................ 6-3
SQL Pseudocolumns............. 6-3
SQL Operators ....................... 6-6
Managing Cursors in PL/SQL.... 6-6
Implicit Cursors..................... 6-6
Attributes of Implicit Cursors .................. 6-7
Guidelines for Using Attributes of Implicit Cursors ....... 6-8
Explicit Cursors ..................... 6-8
Declaring a Cursor.......... 6-8
Opening a Cursor............ 6-9
Fetching with a Cursor... 6-9
Fetching Bulk Data with a Cursor ........ 6-11
Closing a Cursor........... 6-12
Attributes of Explicit Cursors ............... 6-12
Querying Data with PL/SQL... 6-14
Selecting At Most One Row: SELECT INTO Statement ...... 6-14
Selecting Multiple Rows: BULK COLLECT Clause ............. 6-15
Looping Through Multiple Rows: Cursor FOR Loop ......... 6-15
Performing Complicated Query Processing: Explicit Cursors ...................... 6-15
Querying Data with PL/SQL: Implicit Cursor FOR Loop.. 6-16
Querying Data with PL/SQL: Explicit Cursor FOR Loops† 6-16
Defining Aliases for Expression Values in a Cursor FOR Loop.................... 6-17
Using Subqueries ..................... 6-17
Using Correlated Subqueries........................ 6-18
Writing Maintainable PL/SQL Queries...... 6-19
Using Cursor Variables (REF CURSORs)........ 6-20
What Are Cursor Variables (REF CURSORs)?...................... 6-20
Why Use Cursor Variables?.......................... 6-20
Declaring REF CURSOR Types and Cursor Variables ........ 6-20
Passing Cursor Variables As Parameters ....................... 6-22
Controlling Cursor Variables: OPEN-FOR, FETCH, and CLOSE................. 6-22
Opening a Cursor Variable.................... 6-22
Using a Cursor Variable as a Host Variable................... 6-24
Fetching from a Cursor Variable .......... 6-25
Closing a Cursor Variable...................... 6-26
Reducing Network Traffic When Passing Host Cursor Variables to PL/SQL ...................... 6-26
Avoiding Errors with Cursor Variables...... 6-27
Restrictions on Cursor Variables ................. 6-27
Using Cursor Expressions........ 6-28
Restrictions on Cursor Expressions............. 6-28
Example of Cursor Expressions ................... 6-29
Constructing REF CURSORs with Cursor Subqueries........ 6-29
Overview of Transaction Processing in PL/SQL ....................... 6-30
Using COMMIT in PL/SQL ......................... 6-30
Using ROLLBACK in PL/SQL..................... 6-31
Using SAVEPOINT in PL/SQL ................... 6-31
How Oracle Does Implicit Rollbacks .......... 6-32
Ending Transactions ........... 6-33
Setting Transaction Properties with SET TRANSACTION† 6-33
Restrictions on SET TRANSACTION .. 6-34
Overriding Default Locking ......................... 6-34
Doing Independent Units of Work with Autonomous Transactions ............... 6-37
Advantages of Autonomous Transactions . 6-37
Defining Autonomous Transactions ........... 6-37
Comparison of Autonomous Transactions and Nested Transactions .. 6-39
Transaction Context..... 6-39
Transaction Visibility... 6-39
Controlling Autonomous Transactions ...... 6-39
Using Autonomous Triggers........................ 6-41
Calling Autonomous Functions from SQL. 6-42
7 Performing SQL Operations with Native Dynamic SQL
Why Use Dynamic SQL with PL/SQL?............... 7-1
Using the EXECUTE IMMEDIATE Statement in PL/SQL ......... 7-2
Specifying Parameter Modes for Bind Variables in Dynamic SQL Strings .... 7-4
Using Bulk Dynamic SQL in PL/SQL ................. 7-5
Using Dynamic SQL with Bulk SQL .............. 7-5
Examples of Dynamic Bulk Binds .................. 7-6
Guidelines for Using Dynamic SQL with PL/SQL...................... 7-7
Building a Dynamic Query with Dynamic SQL...................... 7-7
When to Use or Omit the Semicolon with Dynamic SQL ...... 7-7
Improving Performance of Dynamic SQL with Bind Variables....................... 7-8
Passing Schema Object Names As Parameters ........................ 7-8
Using Duplicate Placeholders with Dynamic SQL ................. 7-9
Using Cursor Attributes with Dynamic SQL 7-9
Passing Nulls to Dynamic SQL .................... 7-10
Using Database Links with Dynamic SQL . 7-10
Using Invoker Rights with Dynamic SQL.. 7-11
Using Pragma RESTRICT_REFERENCES with Dynamic SQL..................... 7-11
Avoiding Deadlocks with Dynamic SQL ... 7-11
Backward Compatibility of the USING Clause .................... 7-12
Using Dynamic SQL With PL/SQL Records and Collections....................... 7-12
8 Using PL/SQL Subprograms
What Are Subprograms?............ 8-1
Advantages of PL/SQL Subprograms.................. 8-2
Understanding PL/SQL Procedures..................... 8-3
Understanding PL/SQL Functions ....................... 8-4
Using the RETURN Statement ........................ 8-5
Declaring Nested PL/SQL Subprograms............ 8-5
Passing Parameters to PL/SQL Subprograms .... 8-6
Actual Versus Formal Subprogram Parameters...................... 8-6
Using Positional, Named, or Mixed Notation for Subprogram Parameters .. 8-7
Specifying Subprogram Parameter Modes.... 8-7
Using the IN Mode ......... 8-7
Using the OUT Mode ..... 8-8
Using the IN OUT Mode 8-8
Summary of Subprogram Parameter Modes .................... 8-9
Using Default Values for Subprogram Parameters................. 8-9
Overloading Subprogram Names ..................... 8-10
Guidelines for Overloading with Numeric Types ............... 8-10
Restrictions on Overloading ......................... 8-11
How Subprogram Calls Are Resolved ............. 8-12
How Overloading Works with Inheritance 8-14
Using Invoker's Rights Versus Definer's Rights (AUTHID Clause)................ 8-15
Advantages of Invoker's Rights ................... 8-16
Specifying the Privileges for a Subprogram with the AUTHID Clause....... 8-16
Who Is the Current User During Subprogram Execution?. 8-16
How External References Are Resolved in Invoker's Rights Subprograms 8-17
The Need for Template Objects in Invoker's Rights Subprograms ....... 8-17
Overriding Default Name Resolution in Invoker's Rights Subprograms.... 8-17
Granting Privileges on Invoker's Rights Subprograms....... 8-18
Granting Privileges on an Invoker's Rights Subprogram: Example...... 8-18
Using Roles with Invoker's Rights Subprograms................. 8-19
Using Views and Database Triggers with Invoker's Rights Subprograms.. 8-19
Using Database Links with Invoker's Rights Subprograms .......................... 8-19
Using Object Types with Invoker's Rights Subprograms ... 8-20
Calling Invoker's Rights Instance Methods ................... 8-21
Using Recursion with PL/SQL 8-21
What Is a Recursive Subprogram?............... 8-21
Calling External Subprograms 8-22
Controlling Side Effects of PL/SQL Subprograms ................... 8-23
Understanding Subprogram Parameter Aliasing ..................... 8-24
9 Using PL/SQL Packages
What Is a PL/SQL Package?........ 9-1
What Goes In a PL/SQL Package? ................. 9-2
Advantages of PL/SQL Packages.......................... 9-3
Understanding The Package Specification ........ 9-3
Referencing Package Contents ........................ 9-4
Restrictions...................... 9-5
Understanding The Package Body....................... 9-5
Some Examples of Package Features ................... 9-6
Private Versus Public Items in Packages ....... 9-8
How Package STANDARD Defines the PL/SQL Environment 9-8
Overview of Product-Specific Packages ............. 9-9
About the DBMS_ALERT Package................. 9-9
About the DBMS_OUTPUT Package ............. 9-9
About the DBMS_PIPE Package .................. 9-10
About the HTF and HTP Packages.............. 9-10
About the UTL_FILE Package...................... 9-10
About the UTL_HTTP Package.................... 9-10
About the UTL_SMTP Package.................... 9-10
Guidelines for Writing Packages....................... 9-10
Separating Cursor Specs and Bodies with Packages................ 9-11
10 Handling PL/SQL Errors
Overview of PL/SQL Runtime Error Handling......................... 10-1
Guidelines for Avoiding and Handling PL/SQL Errors and Exceptions.... 10-2
Advantages of PL/SQL Exceptions ................... 10-3
Summary of Predefined PL/SQL Exceptions .. 10-4
Defining Your Own PL/SQL Exceptions ......... 10-5
Declaring PL/SQL Exceptions ..................... 10-6
Scope Rules for PL/SQL Exceptions ........... 10-6
Associating a PL/SQL Exception with a Number: Pragma EXCEPTION_INIT ................... 10-7
Defining Your Own Error Messages: Procedure RAISE_APPLICATION_ERROR.............. 10-7
Redeclaring Predefined Exceptions............. 10-8
How PL/SQL Exceptions Are Raised................ 10-9
Raising Exceptions with the RAISE Statement ..................... 10-9
How PL/SQL Exceptions Propagate.................. 10-9
Reraising a PL/SQL Exception......................... 10-11
Handling Raised PL/SQL Exceptions............. 10-12
Exceptions Raised in Declarations............. 10-13
Handling Exceptions Raised in Handlers. 10-13
Branching to or from an Exception Handler....................... 10-13
Retrieving the Error Code and Error Message: SQLCODE and SQLERRM........................ 10-14
Catching Unhandled Exceptions ............... 10-15
Tips for Handling PL/SQL Errors............. 10-15
Continuing after an Exception Is Raised ...................... 10-15
Retrying a Transaction ......................... 10-16
Using Locator Variables to Identify Exception Locations..................... 10-17
Overview of PL/SQL Compile-Time Warnings....................... 10-17
PL/SQL Warning Categories ..................... 10-17
Controlling PL/SQL Warning Messages.. 10-18
Using the DBMS_WARNING Package..... 10-19
11 Tuning PL/SQL Applications for Performance
Initialization Parameters for PL/SQL Compilation.................. 11-1
How PL/SQL Optimizes Your Programs.......... 11-2
When to Tune PL/SQL Code ....................... 11-2
Guidelines for Avoiding PL/SQL Performance Problems ...... 11-3
Avoiding CPU Overhead in PL/SQL Code.......................... 11-3
Make SQL Statements as Efficient as Possible............... 11-3
Make Function Calls as Efficient as Possible ................. 11-3
Make Loops as Efficient as Possible ..... 11-4
Do Not Duplicate Built-in String Functions................... 11-5
Reorder Conditional Tests to Put the Least Expensive First .................. 11-5
Minimize Datatype Conversions.......... 11-5
Use PLS_INTEGER for Integer Arithmetic .................... 11-6
Use BINARY_FLOAT and BINARY_DOUBLE for Floating-Point Arithmetic .............. 11-6
Avoiding Memory Overhead in PL/SQL Code ................... 11-6
Be Generous When Declaring Sizes for VARCHAR2 Variables ............ 11-6
Group Related Subprograms into Packages .................. 11-6
Pin Packages in the Shared Memory Pool...................... 11-7
Improve Your Code to Avoid Compiler Warnings ...... 11-7
Profiling and Tracing PL/SQL Programs ......... 11-7
Using The Profiler API: Package DBMS_PROFILER........... 11-7
Using The Trace API: Package DBMS_TRACE .................... 11-8
Controlling the Trace... 11-8
Reducing Loop Overhead for DML Statements and Queries with Bulk SQL.......................... 11-8
Using the FORALL Statement...................... 11-9
How FORALL Affects Rollbacks ........ 11-12
Counting Rows Affected by FORALL with the %BULK_ROWCOUNT Attribute ..... 11-12
Handling FORALL Exceptions with the %BULK_EXCEPTIONS Attribute................. 11-14
Retrieving Query Results into Collections with the BULK COLLECT Clause .................... 11-15
Examples of Bulk-Fetching from a Cursor ................... 11-17
Limiting the Rows for a Bulk FETCH Operation with the LIMIT Clause..................... 11-18
Retrieving DML Results into a Collection with the RETURNING INTO Clause ........ 11-18
Using FORALL and BULK COLLECT Together......... 11-19
Using Host Arrays with Bulk Binds... 11-19
Writing Computation-Intensive Programs in PL/SQL........... 11-20
Tuning Dynamic SQL with EXECUTE IMMEDIATE and Cursor Variables 11-20
Tuning PL/SQL Procedure Calls with the NOCOPY Compiler Hint............. 11-21
Restrictions on NOCOPY. 11-22
Compiling PL/SQL Code for Native Execution....................... 11-22
Before You Begin.............. 11-23
Determining Whether to Use PL/SQL Native Compilation ....................... 11-23
How PL/SQL Native Compilation Works .......................... 11-24
Dependencies, Invalidation and Revalidation............. 11-24
Real Application Clusters and PL/SQL Native Compilation .............. 11-25
Limitations of Native Compilation .... 11-25
The spnc_commands File. 11-25
Setting up Initialization Parameters for PL/SQL Native Compilation...... 11-25
PLSQL_NATIVE_LIBRARY_DIR Initialization Parameter .................. 11-26
PLSQL_NATIVE_LIBRARY_SUBDIR_COUNT Initialization Parameter .................... 11-26
PLSQL_CODE_TYPE Initialization Parameter............ 11-26
Setting Up PL/SQL Native Library Subdirectories ........... 11-27
Setting Up and Testing PL/SQL Native Compilation....... 11-27
Setting Up a New Database for PL/SQL Native Compilation.................... 11-28
Modifying the Entire Database for PL/SQL Native or Interpreted Compilation ............... 11-29
Setting Up Transformations with Pipelined Functions......... 11-31
Overview of Pipelined Table Functions.... 11-32
Writing a Pipelined Table Function........... 11-32
Using Pipelined Table Functions for Transformations...... 11-33
Returning Results from Pipelined Table Functions ........... 11-34
Pipelining Data Between PL/SQL Table Functions........... 11-35
Optimizing Multiple Calls to Pipelined Table Functions.. 11-35
Fetching from the Results of Pipelined Table Functions... 11-35
Passing Data with Cursor Variables.......... 11-36
Performing DML Operations Inside Pipelined Table Functions ................ 11-38
Performing DML Operations on Pipelined Table Functions....................... 11-38
Handling Exceptions in Pipelined Table Functions........... 11-39
12 Using PL/SQL With Object Types
Declaring and Initializing Objects in PL/SQL .......................... 12-1
Declaring Objects in a PL/SQL Block ......... 12-2
How PL/SQL Treats Uninitialized Objects 12-3
Manipulating Objects in PL/SQL ..................... 12-4
Accessing Object Attributes With Dot Notation................... 12-4
Calling Object Constructors and Methods . 12-4
Updating and Deleting Objects.................... 12-5
Manipulating Objects Through Ref Modifiers...................... 12-6
Defining SQL Types Equivalent to PL/SQL Collection Types.......................... 12-6
Manipulating Individual Collection Elements with SQL.... 12-8
Using PL/SQL Collections with SQL Object Types ................. 12-9
Using Dynamic SQL With Objects ................. 12-11
13 PL/SQL Language Elements
Assignment Statement ............. 13-3
AUTONOMOUS_TRANSACTION Pragma.. 13-6
Block Declaration ..................... 13-8
CASE Statement...................... 13-14
CLOSE Statement ................... 13-16
Collection Definition............. 13-17
Collection Methods................ 13-20
Comments ..... 13-23
COMMIT Statement ............... 13-24
Constant and Variable Declaration................. 13-25
Cursor Attributes.................... 13-28
Cursor Variables ..................... 13-30
Cursor Declaration .................. 13-33
DELETE Statement................. 13-36
EXCEPTION_INIT Pragma ... 13-38
Exception Definition.............. 13-39
EXECUTE IMMEDIATE Statement ................ 13-41
EXIT Statement ....................... 13-44
Expression Definition............ 13-45
FETCH Statement ................... 13-53
FORALL Statement................ 13-56
Function Declaration .............. 13-59
GOTO Statement.................... 13-63
IF Statement.. 13-64
INSERT Statement .................. 13-66
Literal Declaration.................. 13-68
LOCK TABLE Statement........ 13-71
LOOP Statements ................... 13-72
MERGE Statement .................. 13-76
NULL Statement ..................... 13-77
Object Type Declaration ........ 13-78
OPEN Statement..................... 13-80
OPEN-FOR Statement ............ 13-82
Package Declaration............... 13-85
Procedure Declaration ............ 13-90
RAISE Statement.................... 13-94
Record Definition................... 13-95
RESTRICT_REFERENCES Pragma ................ 13-98
RETURN Statement .............. 13-100
RETURNING INTO Clause† 13-101
ROLLBACK Statement......... 13-103
%ROWTYPE Attribute ......... 13-104
SAVEPOINT Statement........ 13-106
SELECT INTO Statement .... 13-107
SERIALLY_REUSABLE Pragma.................... 13-111
SET TRANSACTION Statement................... 13-113
SQL Cursor . 13-115
SQLCODE Function ............. 13-117
SQLERRM Function ............. 13-118
%TYPE Attribute ................... 13-119
UPDATE Statement.............. 13-121
A Obfuscating PL/SQL Source Code
What is Obfuscation?................. A-1
Tips When Obfuscating PL/SQL Units ........ A-1
Limitations of Obfuscation .. A-2
Limitations of the wrap Utility ............... A-2
Limitations of the DBMS_DDL wrap Function ............... A-2
Obfuscating PL/SQL Code With the wrap Utility ...................... A-2
Input and Output Files for the PL/SQL wrap Utility............ A-3
Running the wrap Utility..... A-3
Obfuscating PL/QL Code With DBMS_DDL Subprograms..... A-4
Using the DBMS_DDL create_wrapped Procedure............... A-4
B How PL/SQL Resolves Identifier Names
What Is Name Resolution? ........ B-1
Examples of Qualified Names and Dot Notation ....................... B-2
Additional Examples of How to Specify Names With the Dot Notation ...... B-3
Differences in Name Resolution Between PL/SQL and SQL... B-3
Understanding Capture............. B-4
Inner Capture........................ B-4
Same-Scope Capture............ B-5
Outer Capture....................... B-5
Avoiding Inner Capture in DML Statements ... B-5
Qualifying References to Object Attributes and Methods ....... B-6
References to Attributes and Methods.......... B-6
References to Row Expressions...................... B-7
C PL/SQL Program Limits
D PL/SQL Reserved Words and Keywords

READ / DOWNLOAD this Oracle PL/SQL User's Guide and reference pdf study material


Resource: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261.pdf
Posted By : Oracle Brain
On date : 09.25.09

Most used ORACLE Database Tutorials

Oracle SQL Developer 1.5.5 download and installation
To install Oracle SQL Developer 1.5.5 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. A Check for Updates facility is available to install third-party database drivers, if required.
Oracle Tutorials ( Ebooks , pdf's )
Oracle 8i the Complete ReferenceMcGrawHill-Oracle_Database_10g_New_Features.chm Database.10g..High.Availablity.with.RAC.Flashback.&.Data.Guard McGraw Hill - Oracle Database 10g, A Beginner's Guide.chm
Mastering Oracle PL/SQL: Practical Solutions - pdf tutorial
This book offers a wealth of tips, techniques, and complete strategies for maximizing the benefits of PL/SQL within your organization. By the end of this book, youíll be as convinced as we are that PL/SQL isnít just a useful toolóitís an integral part of any Oracle application youíll ever develop.
Oracle 10g Database PL/SQL User's Guide and Reference study material - pdf tutorial
Anyone developing PL/SQL-based applications for Oracle should read this book. This book is intended for programmers, systems analysts, project managers, database administrators, and others who need to automate database operations. People developing applications in other languages can also produce mixed-language applications with parts written in PL/SQL.
Oracle interview questions and answers
These are some common oracle interview questions with answers.
Oracle Database SQL Quick Reference tutorial
This quick reference contains a high-level description of the Structured Query Language (SQL) used to manage information in an Oracle database.
New Features in Oracle Database 10g
This tutorial provides the details of New Features in Oracle Database 10g
Oracle SQL Parallel Execution tutorial
This Oracle tutorial focuses on SQL parallel execution only, which consists of parallel query, parallel DML (Data Manipulation Language) and parallel DDL (Data Dictionary Language). While this pdf study material focuses on Oracle Database 11g, the information in this paper also applies to Oracle Database 10g and higher, unless explicitly stated.
Oracle SQL Developer Data Modeler tutorial and reference
Oracle SQL Developer Data Modeler is a new, graphical data modeling tool that facilitates and enhances communication between data architects, database administrators, application developers and users, and simplifies the data modeling development process itself.
Oracle Rdb 7 Guide to SQL Programming - pdf tutorial
This manual describes how to design and develop host language application programs that use SQL (structured query language) to store, modify, and retrieve data from Oracle Rdb databases.
Oracle TimesTen In-Memory database Extension for Oracle SQL Developers - pdf tutorial
Oracle TimesTen In-Memory database Extension for Oracle SQL Developers is a free extension to Oracle SQL Developer, a graphical tool that enhances productivity and simplifies database development tasks.
Oracle Database SQL Developer Installation Guide - pdf tutorial
This Oracle SQL installation guide is helpful for those who plan to download SAL Developer kit (.zip ) file and install it as a freestanding tool
SQL Apply Best Practices: Oracle Data Guard 10g study guide and reference
With Oracle Data Guard SQL Apply in Oracle Database 10g, Oracle is addressing the requirements of the business community for an online disaster-recovery solution that also provides a means to offload reporting and decision support operations from he primary database
Oracle SQL Model Clause version 10g - study guide and reference tutorial
Oracle Database 10g introduces an innovative approach to complex SQL calculations: the SQL Model clause.
Best Practices for Minimal Downtime Migration to ASM Oracle 10g tutorial
This oracle tutorial describes procedures to dramatically reduce downtime during the process of migrating Oracle databases residing on raw partitions, volumes or conventional file systems to Automatic Storage Management (ASM) by using Oracle Recovery Manager (RMAN) and Oracle Data Guard.

Latest added ORACLE Database Tutorials

New Features in Oracle Database 10g
This tutorial provides the details of New Features in Oracle Database 10g
Oracle Rdb 7 Guide to SQL Programming - pdf tutorial
This manual describes how to design and develop host language application programs that use SQL (structured query language) to store, modify, and retrieve data from Oracle Rdb databases.
Oracle interview questions and answers
These are some common oracle interview questions with answers.
Oracle SQL Developer Data Modeler Naming Standardization reference guide
SQL Developer Data Modeler provides and uses different elements when applying naming standards to models. You can define and then apply these standards to the different models available in SQL Developer Data Modeler.
Oracle SQL Developer 1.5.5 download and installation
To install Oracle SQL Developer 1.5.5 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. A Check for Updates facility is available to install third-party database drivers, if required.
Oracle SQL Model Clause version 10g - study guide and reference tutorial
Oracle Database 10g introduces an innovative approach to complex SQL calculations: the SQL Model clause.
SQL Apply Best Practices: Oracle Data Guard 10g study guide and reference
With Oracle Data Guard SQL Apply in Oracle Database 10g, Oracle is addressing the requirements of the business community for an online disaster-recovery solution that also provides a means to offload reporting and decision support operations from he primary database
Oracle Database SQL Developer Installation Guide - pdf tutorial
This Oracle SQL installation guide is helpful for those who plan to download SAL Developer kit (.zip ) file and install it as a freestanding tool
Best Practices for Minimal Downtime Migration to ASM Oracle 10g tutorial
This oracle tutorial describes procedures to dramatically reduce downtime during the process of migrating Oracle databases residing on raw partitions, volumes or conventional file systems to Automatic Storage Management (ASM) by using Oracle Recovery Manager (RMAN) and Oracle Data Guard.
Oracle SQL Developer Data Modeler tutorial and reference
Oracle SQL Developer Data Modeler is a new, graphical data modeling tool that facilitates and enhances communication between data architects, database administrators, application developers and users, and simplifies the data modeling development process itself.