Dump the body of a function or procedure in sqlplus
How can I dump out the body of a function or a pr开发者_C百科ocedure when using sqlplus to connect to an oracle database?
select
    text
from
    user_source
where
    type = 'PROCEDURE'
and
    name='YOURPROCEDURENAME'
order by
    line;
Use:
SELECT us.name,
       us.type,
       us.text
  FROM USER_SOURCE us
 WHERE us.type IN ('PROCEDURE', 'FUNCTION')
ORDER BY name, line
Another solution is to use the dbms_metadata api
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.
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论