O'Reilly logo

Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts by John Adolph Palinski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Declaring Variables and Assigning Values

The power of PL/SQL is that it allows the developer to read data into the code block and to manipulate it. In order to bring the attributes into the program, you must have variables that will hold the values. Oracle cannot use the values until they are placed into memory, which happens when they are assigned to a variable. Variables are defined in the declaration section of the code block and will be discussed in this section.

Defining Variables

Variables are defined in the declaration section of the program. The syntax is as follows:

					Variable_name                   datatype(precision);
				

Oracle treats a variable definition similarly to other statements. The definition must end with a semicolon. The definition statement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required