Home » SQL & PL/SQL » SQL & PL/SQL » to know table name of specific data
to know table name of specific data [message #247219] Mon, 25 June 2007 02:09 Go to next message
durai
Messages: 38
Registered: December 2006
Member
vanakkam/hi to all

i have one question,
if i am giving a value/data(say for eg chennai) is it possible to get the tables which all containing chennai

correct me if i wrong

advance thanx to all,
Re: to know table name of specific data [message #247221 is a reply to message #247219] Mon, 25 June 2007 02:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You have to select all fields in all tables.

Regards
Michel
Re: to know table name of specific data [message #247229 is a reply to message #247221] Mon, 25 June 2007 03:00 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
i am not sure but you can do like that ..
you can use "user_tab_columns" table where you will get tables name and column name ...select record one by one from this table and use like command on that colomn


--Yash
Re: to know table name of specific data [message #247280 is a reply to message #247219] Mon, 25 June 2007 06:17 Go to previous messageGo to next message
balaji23_d
Messages: 123
Registered: February 2007
Senior Member
Query like this:

select table_name from user_tab_column where column_name='chennai';
Re: to know table name of specific data [message #247282 is a reply to message #247280] Mon, 25 June 2007 06:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
It is NOT the column name that is 'chennai' it is the data in the column.

Regards
Michel
Re: to know table name of specific data [message #247284 is a reply to message #247280] Mon, 25 June 2007 06:25 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
balaji23_d wrote on Mon, 25 June 2007 12:17
Query like this:

select table_name from user_tab_column where column_name='chennai';


Hmm, that might work if you have designed your tables by wrapping column names in double quotes but NORMALLY column names are in upper case.

Also, I think that you may have mis-understood the question (or maybe I did) I believe that the OP is looking for all tables that CONTAIN DATA equal to (for example) 'chennai' not alll tables that contain columns CALLED chennai.

As Michel, correctly (as per usual) pointed out, the OP will have to select all columns from all tables to get the answer to his question.
Once again, Michel, you beat me to the punch Smile

[Updated on: Mon, 25 June 2007 06:26]

Report message to a moderator

Re: to know table name of specific data [message #247466 is a reply to message #247219] Tue, 26 June 2007 00:57 Go to previous message
durai
Messages: 38
Registered: December 2006
Member
It is NOT the column name that is 'chennai' it is the data in the column.

ya what michel said was right

i need the tables which containing the data chennai
what i want is like GREP in unix to search a data

i tried all_tables, dba_tab_columns
but i couldn't get the answers


ok any way thanx for all who have answered
and i am very grateful to u all


bye take care





Previous Topic: Format problem........
Next Topic: query problem
Goto Forum:
  


Current Time: Sat Dec 07 01:36:26 CST 2024