Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Oracle's equivalent of MySQL's show table command?

Tags:

sql

oracle

I know it is possible to use:

SELECT DISTINCT(table_name) 
  FROM all_tab_cols

Would there be a better way in Oracle to show table, i.e. MySQL's show table; command.

like image 759
Oh Chin Boon Avatar asked Jul 03 '11 14:07

Oh Chin Boon


2 Answers

If you require full structure you may use

SELECT dbms_metadata.get_ddl( 'TABLE', 'MY_TABLE_NAME' ) FROM DUAL;

see more syntax from Reference

like image 61
Narayan Avatar answered Sep 24 '22 14:09

Narayan


Try describe table <table-name> in SQL*Plus. It does all the fetching and nice formatting. Works with tables, but also procedures, triggers, constraints, etc (just use different keywords).

like image 34
9000 Avatar answered Sep 24 '22 14:09

9000