SQL> set long 4000
SQL> select dbms_metadata.get_DDL( 'TABLE','EMP','HR') from dual;
DBMS_METADATA.GET_DDL('TABLE','EMP','HR')
-----------------------------------------------------------------------------
CREATE TABLE "HR"."EMP"
( "ID" NUMBER(10,0),
"NAME" VARCHAR2(30),
"EMAIL" VARCHAR2(100),
"SALARY" NUMBER(10,2)
) 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 "USERS"
SQL> select dbms_metadata.get_DDL( 'INDEX','EMP_EMP_ID_PK','HR') from dual;
DBMS_METADATA.GET_DDL('INDEX','EMP_EMP_ID_PK','HR')
--------------------------------------------------------------------------------
CREATE UNIQUE INDEX "HR"."EMP_EMP_ID_PK" ON "HR"."EMPLOYEES" ("EMPLOYEE_ID")