08b - PL-SQL Fundamentals I - Global Vs Local Objects

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 4

Global vs.

Local Objects
When using Nested Blocks, the declared
objects within the different blocks become
either global or local.
Object Description
Global Any object declared in the Outer Block are global
Local Any declaration made within the Inner Block are
local and only visible to the Inner Block.

Object names may be reused as local


objects within inner blocks.
BlockName.ObjectName

Oracle 11g PL/SQL Fundamentals I


Global vs. Local Exceptions
There is also the concept of both Global
and Local Exceptions.
• All exceptions are considered Local.
• The system looks for the EXCEPTION
clause within that block.
• If no EXCEPTION clause is found, the
system branches to the Outer Block.
• If no EXCEPTION clause if found in the
outermost block, the program terminates.

Oracle 11g PL/SQL Fundamentals I


Global vs. Local Exceptions
When an EXCEPTION is handled in an Inner
Block, you may consider it partially
handled.
• You can use the RAISE statement to
branch the exception in the manner you
wish.

Oracle 11g PL/SQL Fundamentals I


See it in Action

Oracle 11g PL/SQL Fundamentals I

You might also like