开始
set serveroutput on; <<outer>> DECLARE birthdate DATE; BEGIN birthdate:=TO_DATE('2012-05-18','YYYY-MM-DD'); DECLARE birthdate DATE; BEGIN birthdate:=TO_DATE('2012-01-15','YYYY-MM-DD'); dbms_output.put_line('inner date is:' || birthdate); dbms_output.put_line('outer date is:' || outer.birthdate); END; dbms_output.put_line('outer date is:' || birthdate); END;
运行结果:
anonymous block completed inner date is:15-JAN-12 outer date is:18-MAY-12 outer date is:18-MAY-12
结束
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/11/13/2767859.html,如需转载请自行联系原作者