I have to select the rows of data of the table demo where the designation column value matches with any one of the elements of the array. I'm facing problem in 'where' part of the code. How do I compare the values of the array and the designation column?
CREATE OR REPLACE TYPE array_collection IS VARRAY(100) OF VARCHAR2(50);
--
declare
--Initialization
var_array array_collection:=array_collection();
f VARCHAR2(100);
begin
---Storing 3 elements
var_array.extend(3);
var_array(1):= 'Software Engineer';
var_array(2):= 'Account Manager';
var_array(3):= 'Operations Team Leader';
select full_name into f from demo where designation member of var_array;
end;
I want all the rows which has designation 'Software Engineer','Account Manager','Operations Team Leader' from the table demo to be selected.