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!

Doubt Regarding Collection Methods

AJ.MSep 1 2011 — edited Sep 5 2011
Hello,

I am working on Oracle version 10g Release 2

I wanted to know that how can we find a particular name (person) exists in a Collection..

Below is my Code
--------------------------------------------------------------------
DECLARE

TYPE nested_tab IS TABLE OF VARCHAR2(100);
l_tab nested_tab := nested_tab();

BEGIN

SELECT e.ent_id BULK COLLECT INTO l_tab
FROM entity_master e
WHERE e.ent_id IN ('N002208', 'Z002011', 'V002313', 'X002011'..... & so on);

IF l_tab.EXISTS('N002208') THEN
dbms_output.put_line('element exists');
ELSE
dbms_output.put_line('NO element ');
END IF;

END;
/

ORA-06502 - Numeruc or Value Error
--------------------------------------------------------------------


what can be the work around for this...?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2011
Added on Sep 1 2011
27 comments
274 views