Help! can I use host arrays in where clause (pro*c)?

From: sudha rayarao <srayarao_at_tango.cis.ohio-state.edu>
Date: 1996/10/30
Message-ID: <557p0eINNge1_at_tango.cis.ohio-state.edu>#1/1


I tried posting this from my account, but for some reason I didn't see it being posted in the news group. So I am posting this again from my wife's account:

Hi,  

  In one of my programs, I am doing something like this:  

  for (i=0;i<1000;i++)
    EXEC SQL SELECT name INTO :name[i] FROM employee     WHERE emp_id = :emp_id[i];  

  Is there any way I can execute this as a single statement such as  

   EXEC SQL SELECT name INTO :name FROM employee    WHERE emp_id = :emp_id;  

  where name and emp_id are host arrays.  

  I know that the pro*c manual says that I cannot use host arrays in a   where clause (except for subqueries). But, I was just wondering if   there was any other way out so that I don't have to issue the SQL   statement (or open a cursor) 1000 times. For my queries I always get   a unique name from the emp_id.  

  Can anyone help?  

Thanks in advance.  

Sridhar
(pandaris_at_sunray.cb.att.com) Received on Wed Oct 30 1996 - 00:00:00 CET

Original text of this message