Re: Procedure with multiple where clauses

From: damorgan <damorgan_at_exesolutions.com>
Date: Mon, 18 Mar 2002 19:42:33 GMT
Message-ID: <3C964334.E6CBD8A4_at_exesolutions.com>


An excellent suggestion. I am disappointed that I didn't add it to my list.

Thanks.

Daniel Morgan

Prasad Yarlagadda wrote:

> 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 - 20:42:33 CET

Original text of this message