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: <Jay.Miller_at_tdameritrade.com>
Date: Fri, 10 Aug 2007 17:10:23 -0400
Message-ID: <304CF4722010DD4FA19829D09DDB956BAC2EFC@prdhswsemlmb01.prod-am.ameritrade.com>


I think I might not have been clear. I don't need the ddl for existing views, I need to generate ddl to create views on existing tables including the column specs so that I can just modify a few columns. Since I'm creating a few hundred views I'm looking for shortcuts.  

I think Jared's script will do this, will be playing with it this weekend.  

Jay Miller
Sr. Oracle DBA
201.369.8355  


From: Niall Litchfield [mailto:niall.litchfield_at_gmail.com] Sent: Friday, August 10, 2007 10:50 AM
To: Miller, Jay
Cc: oracle-l_at_freelists.org
Subject: Re: View Creation script?

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 - 16:10:23 CDT

Original text of this message

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