상수선어에 일반적인 구문

constant_name CONSTANT datatype := VALUE;

 

For example, to declare salary_increase, you can write code as follows:

 

DECLARE 
salary_increase CONSTANT number (3) := 10; 

 

 

You must assign a value to a constant at the time you declare it. If you do not assign a value to a constant while declaring it and try to assign a value in the execution section, you will get a error. If you execute the below Pl/SQL block you will get error.

 

DECLARE 
 salary_increase CONSTANT number(3); 
BEGIN 
 salary_increase := 100; 
 dbms_output.put_line (salary_increase); 
END; 

 

'데이터베이스 > PL/SQL' 카테고리의 다른 글

PL/SQL SelctQuery/alias column(계산된 열에대한 머릿글)  (0) 2015.11.09
PL/SQL Record  (0) 2015.11.09
PL/SQL Variable  (0) 2015.11.09
PL/SQL PROCEDURE 생성  (0) 2015.11.08
PL/SQL 프로시저구조  (0) 2015.11.08
블로그 이미지

왕왕왕왕

,