Ora Tips

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

SELECT

DBMS_METADATA.GET_DDL('TABLE', 'ITEM_COMMIT_AGG', 'INTAMPS') AS DDL


FROM DUAL;

desc all_tab_columns;

Select data_type from user_tab_columns where TABLE_NAME = 'YourTableName'

SELECT table_name,
column_name,
data_type,
data_length,
nullable
FROM cols
WHERE table_name='&YOUR_TABLE'
ORDER BY column_id

begin
for r in ( select column_name, data_type
from user_tab_columns
where table_name = upper('&&p_1')
order by column_id )
loop
dbms_output.put_line(r.column_name ||' is '|| r.data_type );
end loop;

select column_name, data_type


from all_tab_columns
where table_name = �YOURTABLENAME�

select dbms_metadata.get_ddl('TABLE','DEMO','RAJESH') FROM DUAL;

DBMS_METADATA.GET_DDL('TABLE','DEMO','RAJESH')
--------------------------------------------------------------------------------
CREATE TABLE "RAJESH"."DEMO"
( "NAME" VARCHAR2(9),
"DBID" NUMBER
) 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"

You might also like