Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: So basic - how do I get column names?
SELECT column_name
FROM all_tab_columns
WHERE table_name = 'MYTAB';
Or if you wanted it in a long line, you could use the above as a cursor in a procedure, then use dbms_output.put() to append each column name to the buffer, then print them at the end of the procedure.
Or the methods Jane suggested earlier will of course also work.
Adrian
"Lee Crampton" <lee_at_avbrief.com> wrote in message
news:lYgK7.12484$tm3.1786101_at_news11-gui.server.ntli.net...
> Hi all
>
> Ordinarily something like "select * from mytable where false;" would
return
> column headings (no rows).
> This doesn't work in Oracle8i and I cannot for the life of me find either:
> a) the way to return just headings (tried column heading on, col * on etc)
> b) an alternative way to retrieve column names
> Any help gratefully received
> Lee
>
>
Received on Wed Nov 21 2001 - 11:55:12 CST
![]() |
![]() |