I have a function that returns an Array of codes (NUMBER).
select GET_USER_OFFICE_CODES(10) FROM DUAL;
--output--
DB.OFFICE_CODES(3,4,5,6,7,8,9)
and
select GET_USER_OFFICE_CODES(2) FROM DUAL;
--output--
DB.OFFICE_CODES(1,10,14,21)
In a function I am trying to combine 2 ARRAYS of the same type. I get an error "wrong number of types of arguments in call to 'MULTISET_UNION_ALL'"
create or replace function COMBINE_OFFICE_CODES(
in_local_office_code NUMBER,
in_regional_office_code NUMBER
)
RETURN OFFICE_CODES
IS
local_office_codes OFFICE_CODES;
regional_office_codes OFFICE_CODES;
combined_office_codes OFFICE_CODES;
Begin
local_office_codes := GET_USER_OFFICE_CODES(in_local_office_code);
regional_office_codes := GET_USER_OFFICE_CODES(in_regional_office_code);
combined_office_codes := local_office_codes MULTISET UNION ALL regional_office_codes;
RETURN combined_office_codes;
end
You can use UNION ALL;
*************EIDT *********
You can also get rid of local variables and use directly functions. Try this: