在 oracle 10g 中执行过程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13315425/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:14:53  来源:igfitidea点击:

execute procedure in oracle 10g

oracleprocedure

提问by Layla

I have typed a procedure using the web interface of the Oracle 10g. Compile the code and no error at all. For executing this procedure I should use the command EXECUTE name, but when I put that into a SQL window it does not work at all and says that is an invalid SQL command. The question that I have is how I can execute that procedure? I can access it by the Object Browser, but nothing more. Thanks

我已经使用 Oracle 10g 的 Web 界面键入了一个过程。编译代码,完全没有错误。为了执行这个过程,我应该使用命令 EXECUTE name,但是当我把它放入 SQL 窗口时,它根本不起作用,并说这是一个无效的 SQL 命令。我的问题是如何执行该程序?我可以通过对象浏览器访问它,但仅此而已。谢谢

回答by Nick Krasnov

In order to execute your procedure enclose it with beginendblock. Executecommand is sql*plus's command. To that end to execute your procedure you might write:

为了执行你的程序,用beginend块把它括起来。Execute命令是 sql*plus 的命令。为此,您可以编写以下程序来执行您的程序:

begin 
  your_procedure_name;
end; 

and in sql*plus you would use execor execute(which implicitly encloses your procedure with beginendblock):

并且在 sql*plus 中,您将使用execor execute(它隐式地将您的过程包含在beginend块中):

SQL> exec your_procedure_name;