I need to query the database to get the column names, not to be confused with data in the table. For example, if I have a table named EVENT_LOG
that contains eventID
, eventType
, eventDesc
, and eventTime
, then I would want to retrieve those field names from the query and nothing else.
I found how to do this in:
But I need to know: how can this be done in Oracle?
For SQL Server 2008, we can use information_schema.columns for getting column information
In your case :
You could also try this, but it might be more information than you need:
Just select first row from the table , for oracle :
select * from <table name> where rownum = 1;