Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> What is the fastest/easiest way to find a row in a PL/SQL table
Hi,
DB version: 8.1.6: I have a package that populates a simple PL/SQL table declared like:
TYPE MyType IS TABLE OF varchar2(10) INDEX BY BINARY_INTEGER;
MyTable MyType;
The table is populated via a cursor. My question is, what is the fastest performing way of locating a row in the table based on a supplied varchar2 value? Do I have to loop through each row of the table performing a match as in the following:
for i in 1..MyTable.Count loop vValue := MyTable(i); if vValue = pValue then vResult := 'Y'; end if; end loop;
or is there a quicker way?
Thanks in advance!
Rod Received on Tue Feb 12 2002 - 03:16:45 CST