[program-l] Re: Oracle SQL question

  • From: "Pranav Lal" <pranav.lal@xxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Tue, 8 Aug 2006 06:17:32 +0530

Hi,

One easy way to insert the column names could be via SQL loader. You would
need to have the column names in a text file.

Pranav 

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Eileen Lafond
Sent: Tuesday, August 08, 2006 3:31 AM
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Oracle SQL question

Thanks, but I am a bit confused about your suggestion.

  I have the list of the 384 columns, but don't know the easiest way to
put them in the SQL code. They come from another department and I need
to find out if any of them are actually in my data base.

Since this is production, I don't know if I will be allowed to create a
table.  But if I can and insert my 384 column names into a field called
'column_temp'; I guess that the code would be something like the
following:

select column_name, table_name from all_tab_columns
where column_name= column_temp from temp_table.  

Am I on the right track?

Thanks, again

,
 


Eileen La Fond
Phone (206) 386-0011
e.mail Eileen.LaFond@xxxxxxxxxxx

>>> "Ian Sharpe" <isforums@xxxxxxxx> 8/7/2006 2:35 PM >>>
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
** 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: