Mega Code Archive

 
Categories / Oracle PLSQL / System Tables Views
 

Get table name and table space for a table by its name

SQL> SQL> create table foo (a int ); Table created. SQL> SQL> SQL> select table_name, tablespace_name   2  from user_tables   3  where table_name = 'FOO'; TABLE_NAME                     TABLESPACE_NAME ------------------------------ ------------------------------ FOO                            SYSTEM SQL> SQL> drop table foo; Table dropped. SQL> SQL> create table foo (a int ) tablespace users; Table created. SQL> SQL> select table_name, tablespace_name   2  from user_tables   3  where table_name = 'FOO'; TABLE_NAME                     TABLESPACE_NAME ------------------------------ ------------------------------ FOO                            USERS SQL> SQL> drop table foo; Table dropped. SQL> SQL>