|
Tutorial 8: Building PL/SQL Blocks |
|
Page 2 of 2
SQL > /
Welcome To PL/SQL Programming
PL/SQL procedure successfully completed.

Scope and Visibility of Variables : An identifier in PL/SQL block is considered as local to that block and global to all its Sub-blocks. Which is better understood from the following example.
There are 2 composite datatypes. TABLE and
RECORD. Objects of type RECORD are called records. Objects of type TABLE are called PL/SQL table.
User-Defined Records: The %rowtype attribute can be used to store a record fetched from the table. But it is not possible to declare datatype for the fields in %rowtype. This problem is solved in the object type RECORD. The usage of %rowtype and RECORD object are explained below.


PL/SQL Tables:
PL/SQL tables are modeled as database tables but are not same as database tables.
The size of a PL/SQL table is unconstrained i.e. it can grow dynamically whenever a new
record is added. Its size is constrained only by the available memory. Every PL/SQL table
will have a primary key column of BINARY_INTEGER type.

Trackback(0)

|