How can I get column names from a table in Oracle? How can I get column names from a table in Oracle? oracle oracle

How can I get column names from a table in Oracle?


You can query the USER_TAB_COLUMNS table for table column metadata.

SELECT table_name, column_name, data_type, data_lengthFROM USER_TAB_COLUMNSWHERE table_name = 'MYTABLE'


In SQL Server...

SELECT [name] AS [Column Name]FROM syscolumnsWHERE id = (SELECT id FROM sysobjects WHERE type = 'V' AND [Name] = 'Your table name')

Type = 'V' for viewsType = 'U' for tables


You can do this:

describe EVENT_LOG

or

desc EVENT_LOG

Note: only applicable if you know the table name and specifically for Oracle.