Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Lists and queries

Re: Lists and queries

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 5 May 2003 21:10:58 GMT
Message-ID: <b96k11$g42p7$1@ID-82536.news.dfncis.de>

> Hi All!
>
> I have a trouble with PL/SQL. I have a table like this:
>
> TYPE Id_List IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
> EmptyId_List Id_List;
>
> In a HTML form I have a multiselect combobox named Elements. The Submit
> button calls a PL/SQL procedure defined as follows:
>
> procedure Check(Elements Id_List DEFAULT EmptyId_List)
>
> I have to do a SELECT with a WHERE clause in which I must utilize all the
> values that are in Elements parameter. Something like this:
>
> SELECT *
> FROM MyTable
> WHERE Code = (Any of the value in the Elements list);
>
> How can I realized this type of query? Anyone can help me?
> Thanks to all in advance.

Are you sure you need an "index by" table? It looks like a table type is sufficiant.

Check is a reserved word.

Try this:

create or replace TYPE Id_List IS TABLE OF NUMBER;-- INDEX BY BINARY_INTEGER; /

create or replace procedure Check_(Elements Id_List DEFAULT Id_List()) as
begin
  for r in (select column_value from table(Elements)) loop     dbms_output.put_line(r.column_value);   end loop;
end Check_;
/

show errors

exec Check_(Id_List(5,8,10,12));

hth
Rene Nyffenegger

-- 
  Projektleitung und Entwicklung in Oracle/C++/C# Projekten
  http://www.adp-gmbh.ch/cv.html
Received on Mon May 05 2003 - 16:10:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US