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!

Check whether a value present in PL/SQL table containing array of integers

666258Oct 30 2008 — edited Dec 2 2008
Hi,

In my stored procedure i need to check whether a particular value present in PL/SQL table which consists of array of integers.

TYPE TBL_ARR IS TABLE OF NUMBER(2);

ARR TBL_ARR;

Now i need to check whether 2 is present in array ARR.

i have used MEMBER OF function to check this as below


IF(2 MEMBER OF ARR) THEN
Z:='Present';

but MEMBER OF function works only in 10g and not in the versions below 10g.

So please can anyone help me out in doing this. Is there any function to do this? I tried EXISTS of but it checks only the index and not the value.

Looping the entire PL/SQL table of array is the only option or is there any function to do this?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2008
Added on Oct 30 2008
5 comments
9,049 views