开始
set serveroutput on;<> 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 completedinner date is:15-JAN-12outer date is:18-MAY-12outer date is:18-MAY-12
结束