Please help for resolving error for PIPELINED table function call [message #669332] |
Mon, 16 April 2018 05:15  |
 |
msol25
Messages: 396 Registered: June 2011
|
Senior Member |
|
|
Hi,
Please help me to resolve the below error.
//Package spec
create or replace package perf_imp
as
TYPE t_row IS RECORD
(
col1 number(9,0),
col2 number(12,0)
);
TYPE t_tab IS TABLE OF t_row;
FUNCTION get_tab(p_col_1 number)
RETURN t_tab PIPELINED;
end;
/
//Package Body
create or replace package body perf_imp
as
FUNCTION get_tab(p_col_1 number)
RETURN t_tab PIPELINED
IS
l_row t_row;
CURSOR C1
IS
SELECT col1,col2
FROM tab1
where col1 = p_col_1;
BEGIN
FOR r1 IN c1
LOOP
l_row.col1 := r1.col1;
l_row.col2 := r1.col2;
END LOOP;
RETURN;
END;
END;
Executing query:
select *
from table(perf_imp.get_tab(10));
Error:
ORA-04063: package body "DNA_OWNER.PERF_IMP" has errors
04063. 00000 - "%s has errors"
*Cause: Attempt to execute a stored procedure or use a view that has
errors. For stored procedures, the problem could be syntax errors
or references to other, non-existent procedures. For views,
the problem could be a reference in the view's defining query to
a non-existent table.
Can also be a table which has references to non-existent or
inaccessible types.
*Action: Fix the errors and/or create referenced objects as necessary.
|
|
|
|
|