How to make simple "search" on the object Table or VARRAY?

I do a simple bulk collect into a local table type and need a way to determine whether an item exists in this type of local table inside an if condition. I can't understand the syntax. Here is the code:


DECLARE
type emp_roles is table of the varchar2 (10);
v_emp_roles emp_roles;


BEGIN
-Determine the role of the current employee
Select ef.emp_function_code bulk collect
in v_emp_roles
of emplyee_function ef
where ef.emp_no = 1234;

If 'HOMEMRKT' in (v_emp_roles) then
null;
elsif "IMMIGRAT" then in (v_emp_roles)
null;
"INVENTOR" elsif then in (v_emp_roles)
null;
elsif 'TEMPHOUS' in (v_emp_roles) then
null;
end if;


Any ideas how to proceed?

Thank you

'Member ':

DECLARE
  type emp_roles is table of varchar2(10);
  v_emp_roles emp_roles;
BEGIN
   select * bulk collect
          into v_emp_roles
   from table(sys.ku$_vcnt('IMMIGRAT','TEMPHOUS'));

   if 'HOMEMRKT' member of (v_emp_roles) then
      dbms_output.put_line('HOMEMRKT');
   end if;
   if 'IMMIGRAT' member of (v_emp_roles) then
      dbms_output.put_line('IMMIGRAT');
   end if;
   if 'INVENTOR' member of (v_emp_roles) then
      dbms_output.put_line('INVENTOR');
   end if;
   if 'TEMPHOUS' member of (v_emp_roles) then
      dbms_output.put_line('TEMPHOUS');
   end if;
end;

Best regards
Sayan Malakshinov

Tags: Database

Similar Questions

Maybe you are looking for

  • express error airport; No DNS server address

    OSX El Capitan 10.11.6 MacBook Pro mid-2009 Coupled with Airport Express Airport Extreme. Time Warner Cable improved the internet in our area and it took a new modem. At the new modem and Airport Extreme works with it, having to put the modem in Brid

  • Portege Z30-A-1E1 - blue screen and reboot

    Hello I have a model A-Z30-1E1 with 8.1 for Windows Pro 64-bit. I have the problem of ad, randomly, I got a blue screen and restarting the laptop, without giving error messages.In the event log windows that I can't find anything that clearly led to a

  • Satellite Pro A60 (PSA65E) - compatible with SP2?

    Documentation, I don't think it's - Satellite A60 is but isn't a Pro A60 - can someone confirm for me be it? Thank you!

  • Tecra M7: Various errors after upgrading the BIOS version 3.30

    After that I updated my bios to 3.30 I have the following problem: -A edge wireless turns off after a while and can not be activated until I restart.-Battery information is wrong. I tested the system, I can use 1 hour after he said that my battery is

  • How to make a vertical scrolling graphic?

    I need to create a chart that contains data flowing vertically from top to bottom.  I know I can do a work-around by creating a chart with a buffer that behaves like a chart, but I wonder if there isn't an easier way.  The only modes graphic I see ar