1、函数里面嵌套声明函数
CREATE OR REPLACE FUNCTION fun_in_fun_test(i_info varchar2 )RETURN varchar2 IS
v int ;
FUNCTION ret(i_1 varchar )RETURN varchar2 IS
FUNCTION in_ret(v1 varchar )RETURN varchar2 IS begin return v1; end;
BEGIN
RETURN '第二层结果之:' || in_ret(i_1);
END ;
BEGIN
RETURN ret(i_info);
END;
2、函数里面嵌套声明存储过程
CREATE OR REPLACE FUNCTION fun_in_proc_test(i_info varchar2 )RETURN varchar2 IS
v int ;
procedure ret(i_1 varchar ) IS
BEGIN
dbms_output.put_line('in procedure: '|| i_1);
END ;
BEGIN
ret(i_info);
RETURN (i_info);
END;
3、存储过程里面嵌套声明函数
create or replace procedure proc_in_proc_test(i_info varchar2 ) IS
v int ;
procedure ret(i_1 varchar ) IS
BEGIN
dbms_output.put_line('in procedure: '|| i_1);
END ;
BEGIN
ret(i_info);
END;
4、存储过程里面嵌套声明存储过程
create or replace procedure proc_in_proc_test(i_info varchar2 ) IS
v int ;
procedure ret(i_1 varchar ) IS
BEGIN
dbms_output.put_line('in procedure: '|| i_1);
END ;
BEGIN
ret(i_info);
END;