From: "John T" <jlt1@mediaone.net>
Subject: dynamic sql or not?  that is the question
Date: 2000/08/08
Message-ID: <vLTj5.13972$c8.3949530@typhoon-news1.southeast.rr.com>#1/1
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
X-Complaints-To: abuse@mediaone.net
X-Trace: typhoon-news1.southeast.rr.com 965740635 24.88.36.34 (Tue, 08 Aug 2000 09:17:15 EDT)
Organization: MediaOne - Atlanta
X-MSMail-Priority: Normal
NNTP-Posting-Date: Tue, 08 Aug 2000 09:17:15 EDT
Newsgroups: comp.databases.oracle.tools


I am not a PROC or SQL wizard but I believe that the only way to accomplish
what I want is dynamic sql.  I am developing a PROC application with 8.0.5.
My program is being passed a list of keywords to search for.  I am trying to
look up titles of documents based on the number of hits on the keywords.  If
I was writing the sql myself it would look something like:

select id, count(id)  from keywords
where keyword like 'keyword1%' or keyword like 'keyword2%' ...or keword like
'keywordn%'
group by id
order by count(id) desc;

From my understanding of PROC, I need to use method 4 to generate the
dynamic where clause.  Am I nuts and can someone give me an example?

Also, I will then need a dynamic sql statement that looks like:

Select * from titles where id in (list from above query).

Thanks in advance for your help.

--John
jlt1@mediaone.net







