如何检索 Oracle 过程或函数的主体
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/554115/
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
How to retrieve the body of an Oracle procedure or function
提问by Mike Hofer
What I'd like to be able to do is retrieve the schema information for subprograms, functions, package specifications and package bodies from an Oracle 9i database so that I can present them to the user in a C# client using the classes in the System.Data.OracleClient namespace.
我希望能够从 Oracle 9i 数据库中检索子程序、函数、包规范和包主体的模式信息,以便我可以使用 System. Data.OracleClient 命名空间。
So far, I've been able to display the high level schema data far faster than Java applications can, but the packages and functions are beyond my grasp. I can show the columns, their types, the indexes, table- and column level comments, and all sorts of reallyuseful information in really useful ways. Now, if I could just get to the procedures.
到目前为止,我已经能够比 Java 应用程序更快地显示高级模式数据,但是包和函数超出了我的掌握。我可以以非常有用的方式显示列、它们的类型、索引、表级和列级注释以及各种非常有用的信息。现在,如果我能进入程序。
回答by Eddie Awad
Query the data dictionary table ALL_SOURCE http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch2124.htm#1300946
查询数据字典表ALL_SOURCE http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch2124.htm#1300946
回答by cagcowboy
Does this help? Not clear whether you wanted to get this via System.Data.OracleClient or via SQL?
这有帮助吗?不清楚您是想通过 System.Data.OracleClient 还是通过 SQL 获得它?
SELECT TEXT
FROM ALL_SOURCE
WHERE NAME = <proc_name>
AND OWNER = <schema>