Oracle查询当前用户和当前用户下的所有表
(1)查询当前用户
SQL> show user
USER is "SCOTT"
(2)查询当前用户下的所有表,有三种方法
第一种:
SQL> select table_name from tabs;
TABLE_NAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
WORKERSALARY
WS
6 rows selected.
第二种:
SQL> select table_name from user_tables;
TABLE_NAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
WORKERSALARY
WS
6 rows selected.
第三种:
SQL> select tname from tab;
TNAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
WORKERSALARY
WS
6 rows selected.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29485627/viewspace-1246317/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29485627/viewspace-1246317/