0% found this document useful (0 votes)
45 views5 pages

04a - PL-SQL Fundamentals I - Declare Clause

The document discusses the DECLARE clause in PL/SQL, which is used to define internal program objects such as variables. It describes the different types of objects that can be declared, including variables, booleans, constants, records, tables, and user-defined types. The document also provides rules for naming declared objects, such as the name must start with a letter and cannot exceed 30 characters or use certain special characters.

Uploaded by

aditya chauhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views5 pages

04a - PL-SQL Fundamentals I - Declare Clause

The document discusses the DECLARE clause in PL/SQL, which is used to define internal program objects such as variables. It describes the different types of objects that can be declared, including variables, booleans, constants, records, tables, and user-defined types. The document also provides rules for naming declared objects, such as the name must start with a letter and cannot exceed 30 characters or use certain special characters.

Uploaded by

aditya chauhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

The DECLARE Clause

• DECLARE Clause Objects


• Available Data Types
• Declare Simple Types
• Declare Complex Types
• %TYPE
• %ROWTYPE
• TYPE…TABLE
• TYPE…RECORD
• User-Defined Types

Oracle 11g PL/SQL Fundamentals I


DECLARE Clause Objects
The DECLARE Clause is used to define
(declare) internal program objects, such as
variables.
• The following
Object
are among PL/SQL objects
Explanation
Variable An element internal to the program that can
hold and modify values.
Boolean A simple type containing TRUE/FALSE/NULL
Constant Similar to a variable, but cannot be changed.
Record Complex object that matches the structure of a
table within the database yet holds a single
record.

Oracle 11g PL/SQL Fundamentals I


DECLARE Clause Objects (cont)
Object Explanation
Table Complex object that matches the structure of
a table within the database.
User- A type that uses a combination of the
defined predefined objects to create a new type
type unique to the program.

DECLARE
--Define variables
EmpLname VARCHAR2(20);
EmpSalary NUMBER(6);
EmpBdate DATE;

BEGIN

END;

Oracle 11g PL/SQL Fundamentals I


Object Name Rules
When selecting a name for a declared object,
there are some rules you must follow:
• Maximum length is 30 characters.
• The first character must be a letter.
• The following table outlines characters that are
legal and illegal.
Legal Illegal
$ &
# - (dash)
_ (underscore) /
(space)

Oracle 11g PL/SQL Fundamentals I


See it in action

Oracle 11g PL/SQL Fundamentals I

You might also like