Almost every PL/SQL block you write will define and manipulate program data . Program data consists of data structures that exist only within your PL/SQL session (physically, within the Process Global Area, or PGA, for your session); they are not stored in the database. Program data can be:
The values of variables can change during a program’s execution. The values of constants are static once they are set at the time of declaration.
Scalars are made up of a single value, such as a number or a string. Composite data consists of multiple values, such as a record, a collection, or an object type instance.
Containers may contain information obtained from the database, or data that was never in the database and might not ever end up there.
Before you can work with program data inside your PL/SQL code, you must declare data structures, giving them names and datatypes.
This chapter describes how you declare program data. It covers the rules governing the format of the names you give them. It offers a quick reference to all the different types of data supported in PL/SQL and explores the concept of datatype conversion. The chapter finishes with some recommendations for working with program data. The remaining chapters in this part of the book describe specific types of program data.
To work with a variable or a constant, you must first declare it, and when you declare ...