在另一个存储过程中定义Oracle过程的语法是什么? [英] What is the syntax to define an Oracle procedure within an another stored procedure?
本文介绍了在另一个存储过程中定义Oracle过程的语法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
经过多次Google和SO搜索后,我找不到这个简单问题的明确答案:
After many Google and SO searches, I cannot find a definitive answer to this simple question:
如何在另一个要使用的过程中定义一个过程?
How can I define a procedure inside of another procedure to use?
我知道有嵌套的块和嵌套的过程,但是我还没有看到想要的确切语法.即
I know that there are nested blocks and nested procedures, but I haven't seen the exact syntax for what I want. i.e.
create or replace
PROCEDURE TOP_PROCEDURE
(...)
IS
-- nested procedure here?
BEGIN
NULL;
END;
推荐答案
create or replace
PROCEDURE TOP_PROCEDURE
(...)
IS
variable NUMBER;
PROCEDURE nested_procedure (...)
IS
BEGIN
NULL;
END;
PROCEDURE another_nested_procedure (...)
IS
BEGIN
NULL;
END;
BEGIN
NULL;
END;
必须在其他任何内容(例如变量)之后声明本地过程.
Local procedures must be declared after anything else (e.g. variables).
这篇关于在另一个存储过程中定义Oracle过程的语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文