tags:

views:

58

answers:

2

Is there a one-liner out there for this task? Note that I won't be using Oracle's SQL Plus.

A: 

I found the answer just before publishing the question:

SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME='TABLE_NAME'.
Tshepang
I choose this due to greater simplicity.
Tshepang
+3  A: 

This statement will select all the columns for a table, just replace 'TABLE_NAME' with the actual name of the table. Keep in mind that the tables names are uppercase.

select utc.column_name 
  from user_tab_columns utc
 where utc.TABLE_NAME = 'TABLE_NAME'
 order by utc.COLUMN_ID
Welton v3.50
what's the use of 'utc' and why r u ordering? thing is my answer gives the same result as urs.
Tshepang
utc is just an alias for the table name. The SQL program I use has something like intellisence so it pops up column names after the dot. It's just a habit of mine from using the software. And I ordered the columns just so that they appear in the same order that they are declared in the table. Your answer does provide the same information.
Welton v3.50