Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: retrieving only the column label

Re: retrieving only the column label

From: Lothar Armbrüster <la_at_oktagramm.de>
Date: Sat, 10 Mar 2001 18:51:40 +0100
Message-ID: <PM00037F2ACAF4CC87@hades.unknown.dom>

Lee, Seung K. wrote:
> Good day group...
>
> here's my problem
>
> All I want the query to return is just the column label,
> preferably with a delimiter I can assign.
>
> Let me elaborate.
> I have
>
> select col1 as NAME, col2 as EMAIL from TABLE;
>
> it would give
>
> NAME EMAIL
> ---------------------------------
> Leee Lee_at_somewhere.com
> .........
> .........
>
> I just want "NAME and EMAIL". Straight forwardly anything after AS.
> If possible with a delimeter ,(comma)
> which would give name,email. Don't need the query result.
>

Try this:

select col1 as NAME, col2 as EMAIL from TABLE where rownum<1;

This will give you no rows of output but the fieldnames etc. of any possible result.
But beware if your query is more complicated than this Oracle will do some processing even if no output is generated.

Hope that helps,
Lothar

-- 
Lothar Armbrüster       | la_at_oktagramm.de
Hauptstr. 26            | la_at_heptagramm.de
D-65346 Eltville        | lothar.armbruester_at_t-online.de
Received on Sat Mar 10 2001 - 11:51:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US