RE: View Creation script?
- From: <Jay.Miller@xxxxxxxxxxxxxxxx>
- To: <niall.litchfield@xxxxxxxxx>
- Date: Fri, 10 Aug 2007 17:10:23 -0400
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@xxxxxxxxx] Sent: Friday, August 10, 2007 10:50 AM To: Miller, Jay Cc: oracle-l@xxxxxxxxxxxxx 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@xxxxxxxxxxxxxxxx <Jay.Miller@xxxxxxxxxxxxxxxx > 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