I have a table valued function:
create or replace
FUNCTION "GetPositionsWithSymbol"
(
par_Symbol "Symbols"."Symbol"%TYPE,
ErrorCode OUT "ErrorDefs"."ErrorCode"%TYPE
)
RETURN "TableTypes"."PositionTable"
and the type definition is as follows:
create or replace
PACKAGE "TableTypes" AS
TYPE "PositionTable" IS TABLE OF MainSchema."Positions"%ROWTYPE;
END "TableTypes";
when I call this function, I need to iterate on the result, something like this:
for rec in (select * from table(MainSchema."GetPositionsWithSymbol"(par_Symbol, ErrorCode)))
loop
var_TotalGivenAmount := var_TotalGivenAmount + rec."Amount";
end loop;
but this syntax results in error and oracle claims that rec."Amount" is not recognized and must be declared. Am I using the wrong syntax for this?
EDIT: I call the function from another Schema.