DECLARE TYPE HASH_TYPE IS TABLE OF NUMBER INDEX BY VARCHAR2(20); mno_array HASH_TYPE; mno_id VARCHAR2(20); BEGIN FOR r IN (SELECT DT_PARTY.HOST_MNO_ID FROM RESOURCE_DB.HT_SIM_PARTY, RESOURCE_DB.DT_PARTY WHERE HT_SIM_PARTY.PARTY_ID = DT_PARTY.PARTY_ID AND HT_SIM_PARTY.SIM_ID = 'SIM_0000000000000184') LOOP MNO_ARRAY(R.HOST_MNO_ID) := 1; END LOOP; IF mno_array.EXISTS('BT') THEN DBMS_OUTPUT.PUT_LINE('BT=YES'); END IF; END;