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

From: Sridhar Pandari <pandaris_at_jecsun.cb.att.com>
Date: 1996/10/29
Message-ID: <555vcr$os7_at_newsb.netnews.att.com>#1/1


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

-- 


                             \\/\\//
                             | O O |
Received on Tue Oct 29 1996 - 00:00:00 CET

Original text of this message