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: How do you search through multiple tables?

Re: How do you search through multiple tables?

From: Richard Ward <Richard_at_ctcal.ctech.ac.za>
Date: Wed, 19 Feb 2003 13:07:21 +0200
Message-ID: <b2voh1$2dbm$2@news.adamastor.ac.za>


Not sure how to do it in PLSQL, but in perl, you could do a

$SQL= "select table_name from user_tables
(optional)
where table_name like '%your_50_tables%' "

$dbh->do($SQL);

while((@row) = $sph->fetchrow_array())
  {
# then have it into a variable and use the variable in your next sql:

  $SQL = "select field1 from $row[0] where field2 like '%string to search for%' ";

# send query to do and get back answer.   }

something like that. get answer from first query, use it to make second query. Unfortunatly for perl, you have to have the BDI and the DBD installed. but the same concept can be used for Pro*C or anything else (probably PL/SQL as well) Hope this helps, mail me if more is needed.

Richard Received on Wed Feb 19 2003 - 05:07:21 CST

Original text of this message

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