Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set long 50000
set pagesize 0
select dbms_metadata.get_ddl('<obj. type>','<name>','<schema>') from dual;
**********************************************************************************
set long 50000
set pagesize 0
select dbms_metadata.get_ddl('TABLE','S_EMP','TEST') from dual;
CREATE TABLE "TEST"."S_EMP"
( "ID" NUMBER(7,0) CONSTRAINT "S_EMP_ID_NN" NOT NULL ENABLE,
"LAST_NAME" VARCHAR2(25) CONSTRAINT "S_EMP_LAST_NAME_NN" NOT NULL ENABLE,
"FIRST_NAME" VARCHAR2(25),
"USERID" VARCHAR2(8),
"START_DATE" DATE,
"COMMENTS" VARCHAR2(255),
"MANAGER_ID" NUMBER(7,0),
"TITLE" VARCHAR2(25),
"DEPT_ID" NUMBER(7,0),
"SALARY" NUMBER(11,2),
"COMMISSION_PCT" NUMBER(4,2),
CONSTRAINT "S_EMP_COMMISSION_PCT_CK" CHECK (commission_pct IN
(10, 12.5, 15, 17.5, 20)) ENABLE,
CONSTRAINT "S_EMP_ID_PK" PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DATA1" ENABLE,
CONSTRAINT "S_EMP_USERID_UK" UNIQUE ("USERID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DATA1" ENABLE,
CONSTRAINT "S_EMP_MANAGER_ID_FK" FOREIGN KEY ("MANAGER_ID")
REFERENCES "TEST"."S_EMP" ("ID") ENABLE,
CONSTRAINT "S_EMP_DEPT_ID_FK" FOREIGN KEY ("DEPT_ID")
REFERENCES "TEST"."S_DEPT" ("ID") ENABLE,
CONSTRAINT "S_EMP_TITLE_FK" FOREIGN KEY ("TITLE")
REFERENCES "TEST"."S_TITLE" ("TITLE") ENABLE
) 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)
TABLESPACE "DATA1"
imp tables=s_emp file=DHUNT.TEST.dump indexfile=EMP_DDL.sql userid=TEST/TEST
Import: Release 9.2.0.4.0 - Production on Wed Jan 26 13:20:22 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export file created by EXPORT:V09.02.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
. . skipping table "S_EMP"
Import terminated successfully without warnings.
d:> type emp_ddl.sql
REM CREATE TABLE "TEST"."S_EMP" ("ID" NUMBER(7, 0) CONSTRAINT
REM "S_EMP_ID_NN" NOT NULL ENABLE, "LAST_NAME" VARCHAR2(25) CONSTRAINT
REM "S_EMP_LAST_NAME_NN" NOT NULL ENABLE, "FIRST_NAME" VARCHAR2(25),
REM "USERID" VARCHAR2(8), "START_DATE" DATE, "COMMENTS" VARCHAR2(255),
REM "MANAGER_ID" NUMBER(7, 0), "TITLE" VARCHAR2(25), "DEPT_ID" NUMBER(7,
REM 0), "SALARY" NUMBER(11, 2), "COMMISSION_PCT" NUMBER(4, 2)) PCTFREE 10
REM PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1
REM FREELIST GROUPS 1) TABLESPACE "DATA1" LOGGING NOCOMPRESS ;
REM ... 25 rows
CONNECT TEST;
CREATE UNIQUE INDEX "TEST"."S_EMP_ID_PK" ON "S_EMP" ("ID" ) PCTFREE 10
INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS
1) TABLESPACE "DATA1" LOGGING ;
CREATE UNIQUE INDEX "TEST"."S_EMP_USERID_UK" ON "S_EMP" ("USERID" )
PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1
FREELIST GROUPS 1) TABLESPACE "DATA1" LOGGING ;
REM ALTER TABLE "TEST"."S_EMP" ADD CONSTRAINT "S_EMP_COMMISSION_PCT_CK"
REM CHECK (commission_pct IN (10, 12.5, 15, 17.5, 20)) ENABLE NOVALIDATE ;
REM ALTER TABLE "TEST"."S_EMP" ADD CONSTRAINT "S_EMP_ID_PK" PRIMARY KEY
REM ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL
REM 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "DATA1" LOGGING
REM ENABLE ;
REM ALTER TABLE "TEST"."S_EMP" ADD CONSTRAINT "S_EMP_USERID_UK" UNIQUE
REM ("USERID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
REM STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE
REM "DATA1" LOGGING ENABLE ;
REM ALTER TABLE "TEST"."S_EMP" ADD CONSTRAINT "S_EMP_MANAGER_ID_FK"
REM FOREIGN KEY ("MANAGER_ID") REFERENCES "S_EMP" ("ID") ENABLE
REM NOVALIDATE ;
REM ALTER TABLE "TEST"."S_EMP" ADD CONSTRAINT "S_EMP_DEPT_ID_FK" FOREIGN
REM KEY ("DEPT_ID") REFERENCES "S_DEPT" ("ID") ENABLE NOVALIDATE ;
REM ALTER TABLE "TEST"."S_EMP" ADD CONSTRAINT "S_EMP_TITLE_FK" FOREIGN
REM KEY ("TITLE") REFERENCES "S_TITLE" ("TITLE") ENABLE NOVALIDATE ;
REM ALTER TABLE "TEST"."S_EMP" ENABLE CONSTRAINT
REM "S_EMP_COMMISSION_PCT_CK" ;
REM ALTER TABLE "TEST"."S_EMP" ENABLE CONSTRAINT "S_EMP_MANAGER_ID_FK" ;
REM ALTER TABLE "TEST"."S_EMP" ENABLE CONSTRAINT "S_EMP_DEPT_ID_FK" ;
REM ALTER TABLE "TEST"."S_EMP" ENABLE CONSTRAINT "S_EMP_TITLE_FK" ;