데이터베이스/PL/SQL
PL/SQL CONSTANT
왕왕왕왕
2015. 11. 9. 10:23
상수선어에 일반적인 구문
constant_name CONSTANT datatype := VALUE;
For example, to declare salary_increase, you can write code as follows:
DECLAREsalary_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; |