Hi,
I want to pass an array of values (say product #s) from Java front end. The number of values in the array is not fixed. I can receive these values in my Oracle backend through a table type used as parameter in a procedure. The question is how can I then use these values in a SQL query. I need to execute a query as follows: SELECT * FROM PRODUCTS WHERE PRODUCT_NO IN (list of values passed in from the array). The way I see it possible is to put this query in a loop:
LOOP
SELECT * FROM PRODUCTS WHERE PRODUCT_NO = <next value in the PL/SQL table>
END LOOP
Is there a more elegant way to do it?
Thanks.
I want to pass an array of values (say product #s) from Java front end. The number of values in the array is not fixed. I can receive these values in my Oracle backend through a table type used as parameter in a procedure. The question is how can I then use these values in a SQL query. I need to execute a query as follows: SELECT * FROM PRODUCTS WHERE PRODUCT_NO IN (list of values passed in from the array). The way I see it possible is to put this query in a loop:
LOOP
SELECT * FROM PRODUCTS WHERE PRODUCT_NO = <next value in the PL/SQL table>
END LOOP
Is there a more elegant way to do it?
Thanks.