How Does Oracle query the complete definition statement of an object?

Source: Internet
Author: User
How Does Oracle query the complete definition statement Syntax of an object: DBMS_METADATA.GET_DDL (object_typeINVARCHAR2, nameINVA

How Does Oracle query the complete definition statement Syntax of an object: DBMS_METADATA.GET_DDL (object_type IN VARCHAR2, name IN VA

How Does Oracle query the complete definition statement of an object?

Syntax:

DBMS_METADATA.GET_DDL (
Object_type IN VARCHAR2,
Name IN VARCHAR2,
Schema IN VARCHAR2 default null,
Version IN VARCHAR2 DEFAULT 'compuble ',
Model IN VARCHAR2 DEFAULT 'oracle ',
Transform IN VARCHAR2 DEFAULT 'ddl ')
Return clob;

Example: select dbms_metadata.get_ddl ('table', 'emp', 'Scott ') from dual;

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 ),

-- Set LONG and pagesize for full display
SQL> 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 INITRANS 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
CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ENABLE,
CONSTRAINT "FK_DEPTNO" foreign key ("DEPTNO ")
REFERENCES "SCOTT". "DEPT" ("DEPTNO") ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 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 CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.