Q
Problem solve Get help with specific problems with your technologies, process and projects.

Passing IDs in an array to a procedure

I am writing a procedure that will be called from a Java program. I need to pass a set of IDs to the procedure and this list will be used in the where clause of the SQL in the procedure (e.g. select * from my_table where my_id IN -- list of the IDs passed to the procedure). Should I pass these IDs as an array to the procedure? In that case, how do I use this array in the where clause?
You could pass the IDs as an array to your procedure. You can then extract the IDs from the array and form the dynamic SQL statement. The SQL statement should be opened as a REF cursor and then passed as an out parameter in the procedure, so the Java program can use the result set.

Dig Deeper on Using Oracle PL-SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close