oracle 程序在包体中列出但未在规范中列出
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4682528/
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
Procedure listed in package body but not spec
提问by Matt M
I'm fairly new to Oracle, ok VERY new - but I'm learning. I have a package that compiled without errors. When I open the body (using TOAD), I can see a procedure, but that same procedure does not show up in the spec. What would cause this?
我对 Oracle 还很陌生,好吧,非常新 - 但我正在学习。我有一个编译没有错误的包。当我打开主体(使用 TOAD)时,我可以看到一个程序,但该程序没有出现在规范中。什么会导致这种情况?
Thanks in advance.
提前致谢。
回答by Justin Cave
That simply means that the procedure is private.
这仅仅意味着该过程是私有的。
It is rather common to have procedures and functions in the package body that are not in the package spec. Those methods are only visible to other methods in the package body; they are private methods. That tends to be a useful method to separate the public API of the package from the private implementation details and/or to create methods that you don't want code outside the package to inadvertently call.
在包体中包含不在包规范中的过程和函数是相当常见的。这些方法只对包体中的其他方法可见;它们是私有方法。这往往是将包的公共 API 与私有实现细节分开和/或创建您不希望包外的代码无意中调用的方法的有用方法。