I'm triing to create the following Stored Procedure:

CREATE DBPROC "LUCA"."spAnagrafeCollegamenti" (IN @P1 INTEGER) RETURNS
CURSOR AS
VAR IDColl FLOAT(38);
DECLARE IDCcursor CURSOR FOR
SELECT DISTINCT "IDCollegamento"
FROM "LUCA"."AnagrafeCollegamenti"
WHERE "NumeroPratica" = :@P1
AND "DataAnnullamento" = '1900-01-01';
WHILE $rc = 0 DO BEGIN
FETCH IDCcursor INTO :IDColl;
$CURSOR = 'COLL_CURSOR';
DECLARE :$CURSOR FOR
SELECT "Flag", "NaturaCollegamento", "NumeroPratica", "Intestazione"
FROM "LUCA"."AnagrafeCollegamenti"
WHERE "IDCollegamento" = :IDColl
AND "DataAnnullamento" = '1900-01-01';

END;
CLOSE IDCcursor;

But the result is :
---- Error -------------------------------
Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
Syntax error or access violation;-5015 POS(395) Missing keyword:CURSOR

What's wrong with this code ??
Please Help Me
Luca

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to