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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: View Creation script?

Re: View Creation script?

From: Niall Litchfield <niall.litchfield_at_gmail.com>
Date: Fri, 10 Aug 2007 15:49:35 +0100
Message-ID: <7765c8970708100749j7670ee68hbb3f7f51e9faeb88@mail.gmail.com>


I use DBMS_METADATA

from my extract_schema script

<spool to agenerated sql file,set echo off, accept input variables etc,etc> <set dbms_metadata_transforms>

select 'prompt ''Creating Views.... ''' from dual;
select 'select dbms_metadata.get_ddl(''VIEW'',v.view_name,''&usr'') ddl_col
FROM DBA_VIEWS v WHERE OWNER = ''&usr'';' from dual;

<run the generated script spooling to another file>

cheers

Niall

On 8/9/07, Jay.Miller_at_tdameritrade.com <Jay.Miller_at_tdameritrade.com> wrote:
>
> Before I write one, does anyone have a script handy (or know of one
> online) that will generate the DDL for a view that matches the underlying
> table? I need to create a bunch of views that will differ only slightly
> from their underlying table and am looking for ways to speed it up...
>
>
> Thanks,
> Jay Miller
> Sr. Oracle DBA
>
>

-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 10 2007 - 09:49:35 CDT

Original text of this message

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