Skip to content

Commit 9b54833

Browse files
committed
Extracts the DDL statement for the object when the parameters are passed, Object Name and Object Type
1 parent 49d06f8 commit 9b54833

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ddl_extract.sql

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
REM Script Name : ddl_extract.sql
2+
REM Author : Craig Richards
3+
REM Created : 12-January-2009
4+
REM Last Modified :
5+
REM Version : 1.0
6+
REM
7+
REM Modifications :
8+
REM
9+
REM Description : Extracts the DDL statement for the object when the parameters are passed, Object Name and Object Type
10+
11+
REM extract_object.sql <file> <name> <type>
12+
13+
SET ECHO OFF
14+
SET HEADING OFF
15+
SET FEEDBACK OFF
16+
SET VERIFY OFF
17+
SET LINESIZE 10000
18+
SET LONG 2000000000
19+
SET LONGCHUNKSIZE 16000
20+
SET TRIMSPOOL ON
21+
SET PAGESIZE 0
22+
23+
COLUMN test FORMAT A10000
24+
25+
DEFINE _object_file = '&1'
26+
DEFINE _object_name = '&2'
27+
DEFINE _object_type = '&3'
28+
29+
SPOOL &_object_file
30+
31+
SELECT DBMS_METADATA.GET_DDL('&&_object_type', '&&_object_name',USER) test FROM DUAL;
32+
33+
SPOOL OFF
34+
35+
REM End of Script

0 commit comments

Comments
 (0)