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

How do you search through multiple tables?

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Wed, 19 Feb 2003 16:39:13 -0000
Message-ID: <E2F6A70FE45242488C865C3BC1245DA70353AAF3@lnewton.leeds.lfs.co.uk>


Hi Matthias,

It needed to be 'INTO MyResult USING TextToFind' otherwise it won't compile :o)

However, it's going to hard parse every time anyway as the query expands out to have a different column name each time, and a different table name (less often) at others, so I'm afraid parsing is what we get stuck with because the following is (unfortunately) not allowed :

        EXECUTE IMMEDIATE 'select 1 from dual where exists '||
                                  '(select 1 from :table '||
                                  ' where :column like ''%'' ||
:TextToFind || ''%'')'   
                           INTO MyResult
                           USING x.table_name, x.column_name,
TextToFind;

Regards,
Norman.



Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar_at_LFS.co.uk
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com

-------------------------------------

-----Original Message-----
From: Matthias Rogel [mailto:rogelREMOVE_at_THISweb.de] Posted At: Wednesday, February 19, 2003 3:16 PM Posted To: server
Conversation: How do you search through multiple tables? Subject: Re: How do you search through multiple tables?

hi norman,

a small improvement suggestion

please change

<SNIP> Received on Wed Feb 19 2003 - 10:39:13 CST

Original text of this message

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