PL/SQL (MOSC)

MOSC Banner

Error using Package with TableType%ROWTYPE

edited Jun 1, 2019 5:01AM in PL/SQL (MOSC) 4 commentsAnswered

I am using the below format to return a table via stored procedure through a Table Function. I am using a third party system for BI visualizations that requires stored procedures to be wrapped into Table Functions to be visible for use. I am getting an error on declaring cursor as shown below. I get an error on line 11 below saying it is not permitted. Barring the advice on why I am doing what I am doing, I am looking to see how I can get this working and working efficiently

CREATE OR REPLACE PACKAGE pkg_get_snapshot_data ASTYPE t_get_snapshot_row IS RECORD (     FIELD1 VARCHAR2(10)     FIELD2 NUMBER....(about 40 fields));TYPE t_get_snapshot_tab IS TABLE OF t_get_snapshot_row;TYPE t_get_snapshot_cursor IS SYS_REFCURSOR RETURN t_get_snapshot_tab%ROWTYPE;-- Procedure declaration (to be used in the function)PROCEDURE sp_get_snapshot_data(userid IN varchar2, cursor_ IN OUT t_get_snapshot_cursor);-- Function declarationFUNCTION fn_get_snapshot_any (userid IN varchar2, p_cursor IN OUT t_get_snapshot_cursor)RETURN t_get_snapshot_cursor PIPELINED;--PIPELINED PARALLEL_ENABLE(PARTITION p_cursor BY ANY);END pkg_get_snapshot_data;
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center