Create an Oracle function that returns a table

I think you want a pipelined table function. Something like this: CREATE OR REPLACE PACKAGE test AS TYPE measure_record IS RECORD( l4_id VARCHAR2(50), l6_id VARCHAR2(50), l8_id VARCHAR2(50), year NUMBER, period NUMBER, VALUE NUMBER); TYPE measure_table IS TABLE OF measure_record; FUNCTION get_ups(foo NUMBER) RETURN measure_table PIPELINED; END; CREATE OR REPLACE PACKAGE BODY test AS FUNCTION get_ups(foo … Read more