Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use an array in a SQL Query

user594312Aug 28 2011 — edited Aug 28 2011
Hi

I need to use an array of numbers such as a VARRAY or Associated Index Array so that I can do the following SQL:

select *
from *
where array is null or id is in array

So that if the array is empty it will return all the records, and if the array is not empty then it will return only the rows associated with the ids in the array.

Is this possible?

Regards,

Néstor Boscán
This post has been answered by Solomon Yakobson on Aug 28 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2011
Added on Aug 28 2011
3 comments
6,596 views