Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Capturing script output (without the junk)

Re: Capturing script output (without the junk)

From: G Quesnel <dbaguy_ott_at_yahoo.com>
Date: 28 Sep 2005 09:01:29 -0700
Message-ID: <1127923289.898350.246880@f14g2000cwb.googlegroups.com>


If you are using Oracle 9 or 10, you can use dbms_metadata.get_ddl as in
select dbms_metadata.get_ddl('SEQUENCE','MYSEQ','SCOTT') from dual;

You will want to set long and set pagesize to some large number. One good things about doing it the way you are currently doing it, is that it allows you to programatically change some of the values (ie reset next value to 1, for example).

To eliminate more unwanted stuff from your spool file, put your sql statement in a file, and add the following at the top of the file;
set echo off
set feedback off
set pagesize 0
set linesize 999
set verify off
spool ...
Select 'Create ...
...
spool off
set echo on

HTH Received on Wed Sep 28 2005 - 11:01:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US