Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2003, 01:22 AM
Registered User
 
Join Date: Jul 2003
Location: , , Bangladesh.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.



 
Old October 20th, 2003, 11:44 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not completly sure about what the function does, but try putting a comma in between
LEAD(SKEW), OVER(ORDER BY SKEW)

Ate Lead and Over the same function?
What results do you get with

SELECT SKEW,LEAD(SKEW) OVER(ORDER BY SKEW) AS N_SKEW
FROM tblEVIIIParameter

How many columns do you get?


Sal
 
Old November 14th, 2003, 01:41 PM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Akmhasan!

Consult
"http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:186812348071"

for help. i think there is everything you are looking for.

bye!
oli





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedure muthu555 SQL Server 2000 1 March 5th, 2007 07:13 AM
Maximum stored procedure, function, tirgger error kuku SQL Server 2000 1 November 7th, 2005 03:04 AM
Stored Procedure rajanikrishna SQL Server 2000 0 July 18th, 2005 05:01 AM
Location of Stored Procedure & Function in MySQL kasie MySQL 8 March 22nd, 2005 10:54 AM
C# and stored procedure Msmsn C# 1 August 26th, 2003 11:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.