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 -> Is it possible to use a variable (table of numbers) with 'in' operator?

Is it possible to use a variable (table of numbers) with 'in' operator?

From: kazelot <kazelot_at_thenut.eti.pg.gda.pl>
Date: 19 Mar 2002 05:24:49 -0800
Message-ID: <8a47e227.0203190524.eda74aa@posting.google.com>


I have a table MOZ_WYP:
 CREATE TABLE moz_wyp (

   fk1  NUMBER        NOT NULL,
   fk2  NUMBER        NOT NULL);

Let's say it containst this data:
 FK1,FK2

 1,0
 1,3
 2,1
 2,2
 2,3
 3,0
 3,1
 3,2

The task is to find all FK1 that have given set of FK2 values. I do this with the following SQL:

So far so good.

Now I'd like to have a function that would take a table of numbers as input parameter, return result set (cursor reference).

function get_fk1(at_fk2s in <table_of_number_type>, ac_cur out <cursor_ref_type>)

It should do something like this

Is it possible to use a variable (table of numbers) with 'in' operator? Or should I use dynamic SQL?

TIA,
kazelot Received on Tue Mar 19 2002 - 07:24:49 CST

Original text of this message

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