Re: Procedure with multiple where clauses

From: damorgan <damorgan_at_exesolutions.com>
Date: Mon, 18 Mar 2002 15:49:36 GMT
Message-ID: <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 - 16:49:36 CET

Original text of this message