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: finding column names

Re: finding column names

From: Bola Ogunlana <bolao_at_incads.demon.co.uk>
Date: 1997/10/04
Message-ID: <UXHTXEAwemN0EwjM@incads.demon.co.uk>#1/1

In article <34350938.2E227786_at_gis.shl.com>, karsten <karsten_at_gis.shl.com> writes
>Hi,
>
> I am looking for an efficient way to find out whether a table
> has a certain column (or a set of columns) or not.
>
> As far as I can see, there are two options:
>
> 1) try to select these columns, and catch the exception "invalid column
> name"
>
> 2) query the data dictionary (all_tables / all_tab_columns)
>
> which way is to prefer ? (considering sga, reparsing, caching ....)
>
>Thanks
>Karsten

Personally, I'll go for the second method. To use the first method you'll have to rely on knowing some particular ORA- error number or worse the error text. As we all know, these numbers can't really be relied on not to change in further releases of Oracle.

-- 
Bola Ogunlana
Received on Sat Oct 04 1997 - 00:00:00 CDT

Original text of this message

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