Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: dynamic pl/sql
MD wrote:
> hi ng,
>
> is there a way to pass a list of items into a package or procedure?
>
> for example...
> i want to return some field where name = 'Mark', 'John', 'Mike' -- this list
> will NOT contain a set number of items
>
>
> create procedure test
> vList varchar2
> as
> Select *
> From table
> Where name is in vList (can i use instr and say -- Where instr(vList,
> name) > 0)
>
>
> --------------------------------------------------------------------
> OR
>
> can pl/sql be built in the procedure and be run?
> declare vSQL varchar2
> vSQL = "Select * from table"
> execute vSQL
>
>
> thanks in advance,
> MarkD
Multiple ways. You could pass in an array, you could pass in a user defined datatype.
Take a look at the Advanced Queuing demo in Morgan's Library at www.psoug.org. It contains a UDT named MESSAGE_T. Follow how it is used.
-- Daniel Morgan University of Washington Puget Sound Oracle Users GroupReceived on Fri Oct 06 2006 - 18:58:14 CDT