Oracle PL/SQL:Constants
A constant is a variable that is assigned a value during the declaration using the CONSTANT keyword. A constant variable maintains the same value throughout the life of the procedure. You cannot change the value of a constant outside the declaration. If you try to change the value of a constant outside the declaration section, you will get an error.
To declare a constant,
Syntax is:
VARIABLE_NAMEĀ CONSTANTĀ DATATYPE := VARIABLE_VALUE;
Some examples follow:
DECLARE
v_message CONSTANT VARCHAR2(10) := ‘Hello World’;
v_emp_number CONSTANT NUMBER := 123;
BEGIN
–some executable statments that use these variables
END;