I want to create a function which return VArray and populate the values in select query.
My VArray is:
create type array_squad_t is varray(2) of VARCHAR2(200);
My function is
CREATE OR REPLACE FUNCTION test_varray(
id number
)
RETURN array_squad_t
IS
v_array array_squad_t;
BEGIN
v_array(1) := '1 Val';
v_array(2) := '2 Val';
RETURN v_array;
END;
I want to call it like
SELECT column_value1, column_value2, e.Name FROM employees e, TABLE ( test_varray(1) );
Expected Result:
column_value1 | column_value2 | Name
1 Val | 2 Val | SomeName