Oracle 12c and the VARCHAR2 Data Type

on May 29, 2015

VARCHAR2 is a variable-length alphanumeric data type. In PL/SQL, it may have a length up to 32,767 bytes. When you define the VARCHAR2 variable in the DECLARE section, remember to terminate the line with a semicolon (;). The following is the form of VARCHAR2 variable declarations:


where MAX_LENGTH is a positive integer, as in


You can also set an initial or default value for the variable. This is done on the same line as the variable declaration in the DECLARE section of your program. You can do this by using the following syntax:


The preceding statement will set that value of the variable l_name to the value of ABRAMSON.

Related Posts

Leave a Reply