I\'m new to Oracle and I need to translate my SQL Server stored procedure to oracle. In SQL Server, I have function that returns a table variable.
Executing looks l
ValTBL is so-called nested table. To load data in it please use BULK COLLECT option.
Example:
SELECT * BULK COLLECT INTO tblTSVal FROM TABLE(dbMis.fn_ag_valuesToTable(tsVal));
But that is not root of the "Table or view does not exist." error problem. Please check your rights to execute dbMis.fn_ag_valuesToTable
function.
To use pl/sql function as a table is worth to read about pipelined and parallel table functions. http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/pipe_paral_tbl.htm#ADDCI2140
I haven't tried this, but since you're not returning the query results directly as output (ie you're executing a command), what if you wrapped it in a PL/SQL block?
BEGIN
execute immediate 'insert into tblTSVal(stValue, itemKey, props) ' ||
'select * from ' || dbMis.fn_ag_valuesToTable(tsVal);
END;
/
I'm assuming dbMis.fn_ag_valuesToTable is a function.