Analytical function and stored procedure
Dear All,
I used LEAD analytical function in following SQL statement.
SELECT SKEW,LEAD(SKEW) OVER(ORDER BY SKEW) AS N_SKEW
FROM tblEVIIIParameter
It works fine in SQL plus prompt. But when I use the same SQL statement in writting a stored procedure I got error message.
The Stored Procedure is as follows
CREATE OR REPLACE PROCEDURE sp_GetParforEVIII(
io_cursor IN OUT sp_getData.cursor_Data
)
AS
BEGIN
OPEN io_cursor FOR
SELECT SKEW,LEAD(SKEW) OVER(ORDER BY SKEW) AS N_SKEW
FROM tblEVIIIParameter;
END sp_GetParforEVIII;
Error message is as follows (got during compile the stored procedure)
Errors for PROCEDURE SP_GETPARFOREVIII:
LINE/COL ERROR
-------- -----------------------------------------------------------------
8/29 PLS-00103: Encountered the symbol "(" when expecting one of the
following:
, from into bulk
Could you please tell how I can use analytical function in stored Procedure.
Thanks.
|