PL/SQL Constant


Prev Tutorial Next Tutorial

PL/SQL Constant

AConstant is an identifier which holds data whose value can not be changed at the execution time of program.

Constant declaration

Syntax

constant_name Constant datatype := value;
  • constant_name is the name of the constant it means similar to a variable name.
  • The word Constant is a reserved word and that value does not change.
  • value: value is assigned to constant when it is declared.

Example

declare
 salary_bonus constant number(4); 
begin 
 salary_bonus := 2000; 
 dbms_output.put_line (salary_bonus); 
end; 

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements