Re: Procedure with multiple where clauses

From: Adam Hapworth <hap_at_mikomi.org>
Date: 18 Mar 2002 09:57:51 -0800
Message-ID: <a6cb04db.0203180957.1fae2fc0_at_posting.google.com>


"Wezzzzap" <_no_spam_at_pi.be> wrote in message news:<a748kj$60f$1_at_reader06.wxs.nl>...
> 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

You are going to want to write a package and do some overloading. Basically create a package with the same procedure with the different combinations of the parameters (overloading). You will probably want to break up some of the common funcitionallity of the procedures into functions within that package to make it easier to code. You may also want to look into DBMS_SQL builtin package in PL/SQL which will allow you to do trully dynamic sql statments in you procedure if you feel better doing it that way.

Adam Received on Mon Mar 18 2002 - 18:57:51 CET

Original text of this message