Home > Database > Oracle > How to query all table names in oracle database

How to query all table names in oracle database

青灯夜游
Release: 2022-03-17 16:04:08
Original
46799 people have browsed it

Query method: 1. Use the "SELECT * FROM all_tables WHERE OWNER = 'username'" statement to query all table names of the specified user; 2. Use the "SELECT * FROM user_tables" statement to query the current All table names of the user.

How to query all table names in oracle database

The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.

Oracle queries all table names in the database

The first method

This method specifies the Oracle user name (that is, the schema in Oracle) for query, replace the * in the query condition with TABLE_NAME and only display the table name

-- DWD为用户名,用户名必须是大写,你填你的用户名
SELECT * FROM all_tables WHERE OWNER = 'DWD'
-- 加 ORDER BY TABLE_NAME 是让结果按照表名顺序展示
SELECT * FROM all_tables WHERE OWNER = 'DWD' ORDER BY TABLE_NAME
Copy after login

Second method

View the table under the currently logged in user (mode), without specifying OWNER, replace the * in the query condition with TABLE_NAME and only display the table name

SELECT * FROM user_tables
-- 加 ORDER BY TABLE_NAME 是让结果按照表名顺序展示
SELECT * FROM user_tables ORDER BY TABLE_NAME
Copy after login

Recommended tutorial : "Oracle Tutorial"

The above is the detailed content of How to query all table names in oracle database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template