Re: Procedure with multiple where clauses

From: Prasad Yarlagadda <prasad.yarlagadda_at_motorola.com>
Date: Mon, 18 Mar 2002 10:48:12 -0600
Message-ID: <a755od$2576_at_nntp.cig.mot.com>


I would agree with all the other solutions. I think there is one more way of doing this.

Overloading - Using the same procedure name but with different number of parameters. Depending on the number of parameters passed, it calls the appropriate procedure and does the logic inside.

Can someone comment if he/she can use this kind of approach for the problem?

Thanks
Prasad

"damorgan" <damorgan_at_exesolutions.com> wrote in message news:3C960C9C.7ACE2240_at_exesolutions.com...
> Three solutions. Bill and Ken mention two of them.
>
> 1. Native dynamic SQL
> 2. Ref Cursors (which I would not recommend if scalability is important)
> 3. IF statement.
>
> For example:
>
> IF x = something THEN
> OPEN a_cursor;
> ELSIF x = somethingelse THEN
> OPEN b_cursor;
> ELSE
> OPEN c_cursor;
> END IF;
>
> If you use the explicit fetch/exit syntax a few more IF statements solve
 any
> problems, one for fetching the records and one for closing the cursor.
>
> Daniel Morgan
>
>
>
>
> Wezzzzap wrote:
>
> > Hey,
> >
> > I'm searching for a solution for the next problem :
> >
> > We want to create a 'dynamic procedure' that could be used for multiple
> > search operations.
> >
> > So we give multiple paramaters to the procedure -- not every parameter
 will
> > be used -- and in the procedure we
> > have a select with a where clause that is created from the parameters
 that
> > are filled in ...
> >
> > Is there a solution ?
> >
> > kind reg.
> >
> > Wesley
>
Received on Mon Mar 18 2002 - 17:48:12 CET

Original text of this message