Subject CAN I USE A CURSOR IN SP
Author Enrico
I to all, i have try to use a cursor in a SP like this:

CREATE PROCEDURE "AN$SPSTORISCRANAG"
(
"KEYANRIF" INTEGER,
"DATARIF" DATE
)
RETURNS
(
"RKEYANSTOR" INTEGER,
"RTIPOCITTAD" INTEGER,
"RISDATA" DATE,
"RCADATA" DATE
)
AS
DECLARE CURSOR STISCRANAG FOR
SELECT "KEYAN$STORISCRANAG",
"ISDATAEV",
"CADATAEV"
FROM "AN$STORISCRANAG"
WHERE KEYANAGRAFE = :KEYANRIF
AND ISDATAEV >= :DATARIF;
BEGIN
OPEN CURSOR STISCRANAG;
FETCH CURSOR STISCRANAG INTO :RKEYANSTOR, :RISDATA, :RCADATA;

IF ( SQLCODE = 100 ) /* EOF */ THEN
RTIPOCITTAD = 0;
ELSE
BEGIN
IF ( RCADATAEV >= DATARIF ) THEN
RTIPOCITTAD = 1501; /* RESIDENTE */
ELSE
RTIPOCITTAD = 0;
END

CLOSE CURSOR STISCRANAG;
END
^

but when i execute the SQL above i see this error message:

ISC ERROR CODE:335544569

ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 14, char 9
CURSOR


Bye,
Enrico.