📜  oracle 列出架构中的列 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:18.685000             🧑  作者: Mango

代码示例3
-- Depending on schema grants:
SELECT * FROM USER_TAB_COLS WHERE TABLE_NAME = 'my_table';    -- User tables
SELECT * FROM ALL_TAB_COLS WHERE TABLE_NAME = 'my_table';    -- Access granted
SELECT * FROM DBA_TAB_COLS WHERE TABLE_NAME = 'my_table';    -- All schemas

-- Columns from all tables in a schema (or USER_..., DBA_... instead of ALL_...):
SELECT c.TABLE_NAME, c.DATA_TYPE FROM ALL_TAB_COLS c
JOIN ALL_TABLES t ON t.OWNER = c.OWNER
WHERE OWNER = 'my_schema';