Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how can I list procedure source
Use this script:
set arraysize 1
set echo off
set feedback off
set linesize 1000
set pagesize 0
set termout off
set timing off
set trimspool on
set verify off
spool get_src.wrk
column name noprint
column type noprint
column line noprint
select
s.name
, s.type
, 0 as line
, 'create or replace' as txt
from user_source s
-- union all -- select s.nameReceived on Sun Jul 23 2000 - 00:00:00 CDT
, s.type
, 9999999999999997 as line
, '/'
from user_source s where 1 = 1 and 1 = s.line -- union all -- select s.name
, s.type
, s.line
, s.text
from user_source s -- union all -- select s.name
, s.type
, 9999999999999998 as line
, 'show errors' as txt
from user_source s where 1 = 1 and 1 = s.line -- union all -- select s.name
, s.type
, 9999999999999999 as line
, null as txt
from user_source s where 1 = 1 and 1 = s.line -- order by 1, 2, 3 / spool off -- exit Start it with "sqlplus usr/pass_at_conn @ get_src.sql < nul" on NT or "sqlplus usr/pass_at_conn @ get_src.sql < /dev/null" on Unix. Creates scripts to reproduce your source. Does not work for wrapped functions, of course. Martin John Dunn wrote: > > how can i get the source of a pl/sql procedure or function, from sqlplus? > > John