Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle-l »

Re: How to export a package and a procedure

GovindanK

2007-07-16

Replies:

Re: How to export a package and a procedure

Here is something i have been using for the last few years with good results (pulled this one from asktom long ago .. worth its weight in gold)

$ more getcode_all.sql
set heading off
set feedback off
set linesize 100
set trimspool on
spool getcode_all.out
select '@getcode ' || object_name
from user_objects
where object_type in ( 'PROCEDURE', 'FUNCTION', 'PACKAGE' )
/
spool off

set heading on
set feedback on
set linesize 130
set termout on
@getcode_all.out

$ more getcode.sql
set feedback off
set heading off
set termout off
set linesize 1000
set trimspool on
set verify off
spool &1..sql
prompt set define off
prompt set echo   off
select decode( type||'-'||to_char(line,'fm99999'),
               'PACKAGE BODY-1', '/'||chr(10),
                null) ||
       decode(line,1,'create or replace ', '' ) ||
       text text
  from user_source
 where name = upper('&&1')
 order by type, line;
prompt /
prompt set define on
prompt set echo   on
spool off
set feedback on
set heading on
set termout on
set linesize 100

 HTH

GovindanK

On Sat, 14 Jul 2007 02:56:15 +0530, "nilesh kumar" <nileshkum@gmail.com> said:

Hello All,

I have an issue i need to export a package and a procedure too which is present in another package , is there any solution for this in datapump or exp utility.Or is there any other solution for this to do pls help , i am using 9i and 10g both .

Thanks
Nilesh soni
©2008 dba.5341.com - Jax Systems, LLC, U.S.A.