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.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论