Returning a table from an Oracle function
问题 I've looked at many solutions here to try to solve this and they have gotten pretty far but now I'm in the weeds on some errors that I can#t seem to get past. I am on Oracle 11g. I need a function to return a record set (table). Here is the code I'm using: CREATE TYPE T_TABLE IS OBJECT ( Field1 int , Field2 int ); CREATE TYPE T_TABLE_COLL IS TABLE OF T_TABLE; CREATE OR REPLACE FUNCTION FN_MyFunction RETURN T_TABLE_COLL IS BEGIN FOR I IN (SELECT Field1, Field2 FROM Table1) LOOP IF I.Field1 = 1