Re: Extracting Objects

From: Luggy <dgh_consulting_at_my-deja.com>
Date: Thu, 14 Dec 2000 09:42:16 GMT
Message-ID: <91a4ln$cit$1_at_nnrp1.deja.com>


Hi Jake,

The following should just about do it:

set pagesize 0
set trimspool on
set linesize 32767
set termout off
spool object.lst
select text from dba_source where name = '<object name>' and type = '<object type>' and owner = '<object owner>'; spool off

Things to remember:

  1. For packages with a package header and body, you will have to run the above statement twice (for <object type> = 'PACKAGE' and <object type> = 'PACKAGE BODY').
  2. The resulting spool file will not have a 'CREATE OR REPLACE' at the start of it.
  3. You can of course replace "dba_source" with "all_source" or "user_source", depending on your privileges and who owns the object (s). Note that if using "user_source", you don't need the "and owner = '<object owner>'" bit.

HTH, Dave Henderson.

Sent via Deja.com
http://www.deja.com/ Received on Thu Dec 14 2000 - 10:42:16 CET

Original text of this message