IN/NOT IN example(table collection) : IN « PL SQL « Oracle PL / SQL






IN/NOT IN example(table collection)

   

SQL> CREATE OR REPLACE PROCEDURE in_example AS
  2    TYPE charTable IS TABLE OF VARCHAR2(10);
  3    emp1 charTable;
  4    emp2 charTable;
  5    emp3 charTable;
  6    result BOOLEAN;
  7  BEGIN
  8    emp1 := charTable('A', 'B', 'C');
  9    emp2 := charTable('C', 'D', 'E');
 10    emp3 := charTable('A', 'B', 'C');
 11
 12    result := emp3 IN (emp1);
 13    IF result THEN
 14      DBMS_OUTPUT.PUT_LINE('emp3 in emp1');
 15    END IF;
 16
 17
 18  END in_example;
 19  /

Procedure created.

SQL>

   
    
    
  








Related examples in the same category

1.Use IN operator in procedure
2.IN operator in PL SQL
3.IN operator checks whether a variable value is in a set of comma-delimited values.
4.NOT IN example (table collection)