Mega Code Archive

 
Categories / Oracle PLSQL / PL SQL
 

Use the Oracle10g Collection API COUNT method against an element

SQL> SQL> SET ECHO ON SQL> SET SERVEROUTPUT ON SIZE 1000000 SQL> SQL> DECLARE   2   3    TYPE number_table IS TABLE OF INTEGER;   4   5       6    number_list NUMBER_TABLE := number_table(1,2,3,4,5);   7   8  BEGIN   9  10  11      12    DBMS_OUTPUT.PUT_LINE('Count :'||number_list.COUNT);  13  14  END;  15  / Count :5 PL/SQL procedure successfully completed. SQL>