File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments