Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to turn this query to use BOUND variables?
<karsten_schmidt8891_at_my-deja.com> wrote in message
news:80bh58$ifn$1_at_nnrp1.deja.com...
> Hi,
>
> SELECT * FROM CUSTOMERS WHERE CUSTOMER_ID IN (:b1,:b2,:b3,:b4,:b5,:b6)
>
> parse, bind, execute, fetch.
>
> Note, there is an upper limit on the number of elements in an in list.
> (255, i think)
>
> If you have varying length lists, always have the same statement
> (max number of list elements) and bind the same value multiple times.
> That way you don't use sga for diffeent-looking statements.
You don't have to use dynamic SQL for this. You could have a cursor with a parameter, b1 say, and OPEN, FETCH, CLOSE in a loop for all possible values. Received on Wed Nov 10 1999 - 18:58:19 CST