Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Finding tables that contain a certain column value

 
   Database Forums (Home) -> Oracle RSS
Next:  Newbie  
Author Message
Raptor




Joined: Sep 30, 2005
Posts: 2



(Msg. 1) Posted: Fri Sep 30, 2005 8:30 am
Post subject: Finding tables that contain a certain column value

I'm currently working in Oracle 8i and I'm attempting to write an SQL statement to provide a listing of tables where the column_name contains a certain value, but I'm not having any luck.

I can obtain a listing of all the availabe tables with the column I'm looking for, but I cannot filter the listing further for just the column value.

select table_name from all_tab_columns
where column_name = 'JCN';

I now need to filter the listing further to just those tables that contain the correct value in JCN

Any help would be appreciated.

 >> Stay informed about: Finding tables that contain a certain column value 
Back to top
Login to vote
Mark C. Stock

External


Since: Dec 06, 2003
Posts: 326



(Msg. 2) Posted: Fri Sep 30, 2005 2:41 pm
Post subject: Re: Finding tables that contain a certain column value [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Raptor" wrote in message

> I'm currently working in Oracle 8i and I'm attempting to write an SQL
> statement to provide a listing of tables where the column_name
> contains a certain value, but I'm not having any luck.
>
> I can obtain a listing of all the availabe tables with the column I'm
> looking for, but I cannot filter the listing further for just the
> column value.
>
> select table_name from all_tab_columns
> where column_name = 'JCN';
>
> I now need to filter the listing further to just those tables that
> contain the correct value in JCN
>
> Any help would be appreciated.
>
> --
> Posted using the http://www.dbforumz.com interface, at author's request
> Articles individually checked for conformance to usenet standards
> Topic URL:
> http://www.dbforumz.com/Oracle-Finding-tables-column-ftopict259881.html
> Visit Topic URL to contact author (reg. req'd). Report abuse:
> http://www.dbforumz.com/eform.php?p=895641


you'll need to use dynamic SQL (within PL/SQL), since the table names are
unknown at runtime

you'll end of with something like this (just a sketch, check the PL/SQL
manual for specific reference

for r1 in (
select table_name from user_Tables where c

 >> Stay informed about: Finding tables that contain a certain column value 
Back to top
Login to vote
Jeff Kish

External


Since: Aug 25, 2003
Posts: 22



(Msg. 3) Posted: Mon Oct 03, 2005 4:12 pm
Post subject: Re: Finding tables that contain a certain column value [Login to view extended thread Info.]
Archived from groups: comp>databases>oracle>misc (more info?)

On 30 Sep 2005 14:36:24 -0400, Raptor wrote:

>I’m currently working in Oracle 8i and I’m attempting to write an SQL
>statement to provide a listing of tables where the column_name
>contains a certain value, but I’m not having any luck.
>
>I can obtain a listing of all the availabe tables with the column I’m
>looking for, but I cannot filter the listing further for just the
>column value.
>
>select table_name from all_tab_columns
>where column_name = ’JCN’;
>
>I now need to filter the listing further to just those tables that
>contain the correct value in JCN
>
>Any help would be appreciated.
Hi.
I am not an expert, but I think that it depends on your environment.
the ps sql solution is great.

maybe a batch file solution would fit also, where you spool your output of one
query into a file and then run that file.

what are your constraints in a developement and runtime manner of speaking?
 >> Stay informed about: Finding tables that contain a certain column value 
Back to top
Login to vote
Raptor




Joined: Sep 30, 2005
Posts: 2



(Msg. 4) Posted: Tue Oct 04, 2005 12:30 pm
Post subject: Re: Finding tables that contain a certain column value [Login to view extended thread Info.]

No constraints, just wanted a somewhat simple query to aid the DBA in locating the tables in which the data they are looking for is stored.
 >> Stay informed about: Finding tables that contain a certain column value 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
SQL Column Heading - Hi guys, When we execute a select stmt in sqlplus we don't get the column headings full , it is shown according to the data in that column. So, i want to display the column headings in full as it was mentioned , while creating the table. Can tell by..

Column Name Change - Good Morning, Is it possible to change a column name of a table after the table has been created? I have a table called Members that have FirstName, LastName columns. The problem I have is the information that got put into the table had the names..

[Q] Sorting a column - Hi I have a table T with two columns NAME (VARCHAR2) and POS (NUMBER). I want to write an UPDATE query, which updates the column POS such that its values correspond to the alphabetical order of NAME. UPDATE T t1 SET pos = (SELECT ROWID FROM T t2..

query to combine a column - I have a query that returns something like this, which is in a pl/sql function: id description col3 --------------------------------- 123 dingo stuff123 357 anteater stuff357 357 aardvark stuff357 357 ....

Inserting binary data to an column - Hi, i want to make a proof of concept about handling "binary data". Background: I want to get a binary decription (or hex etc) of a data stored in an column. Later i want to insert this binary/hex etc data directly in a column (by code in pls...
   Database Forums (Home) -> Oracle All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]