oracle 在 sqlplus 中转储函数或过程的主体
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1891094/
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-18 19:39:41 来源:igfitidea点击:
Dump the body of a function or procedure in sqlplus
提问by David Oneill
How can I dump out the body of a function or a procedure when using sqlplus to connect to an oracle database?
使用sqlplus连接oracle数据库时,如何转储函数体或过程体?
采纳答案by dacracot
select
text
from
user_source
where
type = 'PROCEDURE'
and
name='YOURPROCEDURENAME'
order by
line;
回答by OMG Ponies
Use:
用:
SELECT us.name,
us.type,
us.text
FROM USER_SOURCE us
WHERE us.type IN ('PROCEDURE', 'FUNCTION')
ORDER BY name, line
回答by Dinesh Bhat
Another solution is to use the dbms_metadataapi
另一种解决方案是使用dbms_metadataapi
set line 200
set long 10000
select dbms_metadata.ddl('PACKAGE','Package Name') from dual;
You can use this for all metadata including tables, indexes and constraints.
您可以将其用于所有元数据,包括表、索引和约束。