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 -> select ... where col in (collection)

select ... where col in (collection)

From: roger <rsr_at_rogerware.com>
Date: Sun, 07 Sep 2003 21:30:35 GMT
Message-ID: <Xns93EF945151426rsrrogerwarecom@204.127.199.17>


I wonder if I'm missing something obvious, or if I'm trying to do the impossible...

What I want is, within PL/SQL, to use a collection with the IN operator in an SQL statement.

Something like so...

  create or replace type numtab is table of number;
/

  create or replace procedure cproc (cvar numtab)   is
  begin
    for c in (select * from all_users where user_id in (cvar) )     loop

But compiling cproc gives
  PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got RSR.NUMTAB

Should I be able to do this kind of thing or not? If so, what is the magic syntax I'm missing?

Thanks for your help and patience.

roger Received on Sun Sep 07 2003 - 16:30:35 CDT

Original text of this message

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