您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
oracle-变量与默认值设置
发布时间:2017-11-23 15:02:05编辑:雪饮阅读()
变量与默认值示例1:
SQL> declare
2 i number default 9;
3 begin
4 i:=i*2;
5 dbms_output.put_line('double i is'||i);
6 end;
7 /
double i is18
PL/SQL procedure successfully completed.
这里赋值符号使用:=而不是=
变量与默认值示例2:
SQL> declare
2 age int default 20;
3 height int :=170;
4 begin
5 dbms_output.put_line('his age is'||age);
6 dbms_output.put_line('his height is'||height);
7 end;
8 /
his age is20
his height is170
PL/SQL procedure successfully completed.
关键字词:oracle,变量,默认值