How Does Oracle query the complete definition statement Syntax of an object: www.2cto.com DBMS_METADATA.GET_DDL (object_type IN VARCHAR2, name IN VARCHAR2, schema IN VARCHAR2 default null, version IN VARCHAR2 DEFAULT 'compute ', model IN VARCHAR2 DEFAULT 'oracle ', transform IN VARCHAR2 DEFAULT 'ddler') return clob; example: select dbms_metadata.get_ddl ('table', 'emp', 'Scott') from dual; www.2cto.com [SQL] SQL> select dbms_metadata.get_ddl ('table', 'emp', 'Scott ') from dual; DBMS_METADATA.GET_DDL ('table', 'emp', 'Scott ') -------------------------------------------------------------------------------- create table "SCOTT ". "EMP" ("EMPNO" NUMBER (4,0), "ENAME" VARCHAR2 (10 ), -- after LONG and pagesize are SET, SQL is fully displayed.> set long 2000000 SQL> set pagesize 0 SQL> select dbms_metadata.get_ddl ('table', 'emp', 'Scott ') from dual; create table "SCOTT ". "EMP" ("EMPNO" NUMBER (4, 0), "ENAME" VARCHAR2 (10), "JOB" VARCHAR2 (9), "MGR" NUMBER (4, 0 ), "HIREDATE" DATE, "SAL" NUMBER (7,2), "COMM" NUMBER (7,2), "DEPTNO" NUMBER (2,0), CONSTRAINT "PK_EMP" primary key ("EMPNO ") using index pctfree 10 limit 2 MAXTRANS 255 compute statistics storage (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 freelist groups 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT limit DEFAULT) TABLESPACE "USERS" ENABLE, CONSTRAINT "FK_DEPTNO" foreign key ("DEPTNO") REFERENCES "SCOTT ". "DEPT" ("DEPTNO") ENABLE) segment creation immediate pctfree 10 PCTUSED 40 limit 1 MAXTRANS 255 nocompress logging storage (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 freelist groups 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT limit DEFAULT) TABLESPACE "USERS"