Re: dynamic sql or not? that is the question

From: Bill Hamlin <whamlin1_at_rochester.rr.com>
Date: 2000/08/10
Message-ID: <mqFk5.2926$0E5.79420_at_typhoon.nyroc.rr.com>#1/1


Dynamic SQL should work for you here. It takes some getting used to, but I've used it in several projects, and it's just the thing for what you're trying to do, here.

I used the O'Reilly book on Oracle's built in packages to walk me through my initial attempts; it was very helpful.

http://www.oreilly.com/catalog/oraclebip/

Hope this helps!

Bill

"John T" <jlt1_at_mediaone.net> wrote in message news:vLTj5.13972$c8.3949530_at_typhoon-news1.southeast.rr.com...
> 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_at_mediaone.net
>
>
>
>
>
Received on Thu Aug 10 2000 - 00:00:00 CEST

Original text of this message