[program-l] Re: Oracle SQL question

  • From: "Ian Sharpe" <isforums@xxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Mon, 7 Aug 2006 22:35:23 +0100

Hi Eileen

If you need to check for 384 colums you can't get around having to enter them at some point unless you have some way of selecting them from another source. I would suggest simply creating a new table containing 384 rows, one for each column you need to check for, and one column, containing the column name you need to check for itself. How you can do this most easily will help you solve the problem more quickly. Then you reduce the problem to simply joining all_tab_columns to this new table on column name.

Cheers
Ian
----- Original Message ----- From: "Eileen Lafond" <eileen.lafond@xxxxxxxxxxx>
To: <program-l@xxxxxxxxxxxxx>
Sent: Monday, August 07, 2006 9:06 PM
Subject: [program-l] Oracle SQL question



Hi,
I need to determine if certain columns are in our data base tables.  I
have been using the following script to determine if the columns exist
in the data base and in what table if they do.  However, there are quite
a few columns to check.  The code I have been using is as follows and I
have 384 columns left to check.  Is there a simple way to put all of the
columns in the script without having to add 'or column_name = 'ect..'.
select column_name, table_name from all_tab_columns
where column_name = 'STATE';

I hope this makes sense.

Thanks for any help,

Eileen La Fond
Phone (206) 386-0011
e.mail Eileen.LaFond@xxxxxxxxxxx
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq



** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: