Lesson 4 | Variable datatypes |
Objective | Identify the Different Datatypes within PL/SQL |
Identify the Different Datatypes within PL/SQL
Every variable has a datatype, which specifies a storage format, constraints, and a valid range of values.
PL/SQL provides a variety of datatypes: SCALAR, COMPOSITE, REFERENCE, and LOB.
You define a variable for a particular datatype to be able to manipulate the data.
Review the following SlideShow to identify the different datatypes available within PL/SQL.
Program PL/SQL Datatypes
PL/SQL datatypes include all the valid SQL datatypes as well as complex datatypes based on query structures.
Scalar Datatypes
scalar_datatype_name: A predefined scalar data type such as BOOLEAN, NUMBER, or VARCHAR2. Includes any qualifiers for size, precision, and character or byte semantics.
BINARY_DOUBLE FLOAT NUMBER SMALLINT
BINARY_FLOAT INT NUMERIC STRING
BINARY_INTEGER INTEGER NVARCHAR2 TIMESTAMP
BOOLEAN INTERVAL DAY
TO SECOND
PLS_INTEGER TIMESTAMP WITH LOCAL
TIME ZONE
CHAR INTERVAL YEAR
TO MONTH
POSITIVE TIMESTAMP WITH TIME
ZONE
CHARACTER LONG POSITIVEN UROWID
DATE LONG RAW RAW VARCHAR
DEC NATURAL REAL VARCHAR2
DECIMAL NATURALN ROWID
DOUBLE
PRECISION
NCHAR SIGNTYPE
Composite Types
RECORD TABLE VARRAY
Reference Types
REF CURSOR REF object_type
LOB Types
BFILE BLOB CLOB NCLOB
In the next lesson, non-PL/SQL bind and host variables will be discussed.
Variable PL/SQL Data