dynamic sql or not? that is the question

From: John T <jlt1_at_mediaone.net>
Date: 2000/08/08
Message-ID: <vLTj5.13972$c8.3949530_at_typhoon-news1.southeast.rr.com>#1/1


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

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

[Quoted] 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_at_mediaone.net Received on Tue Aug 08 2000 - 00:00:00 CEST

Original text of this message