Subject Re: [ib-support] CAN I USE A CURSOR IN SP
Author Marco Lauria
Hi Enrico,
your procedure should be like this as FB doesn't support Cursor syntax
CREATE PROCEDURE "AN$SPSTORISCRANAG"
(
"KEYANRIF" INTEGER,
"DATARIF" DATE
)
RETURNS
(
"RKEYANSTOR" INTEGER,
"RTIPOCITTAD" INTEGER,
"RISDATA" DATE,
"RCADATA" DATE
)
AS
RTIPOCITTAD = 0;
FOR SELECT "KEYAN$STORISCRANAG",
"ISDATAEV",
"CADATAEV"
FROM "AN$STORISCRANAG"
WHERE KEYANAGRAFE = :KEYANRIF
AND ISDATAEV >= :DATARIF
INTO :RKEYANSTOR, :RISDATA, :RCADATA DO
BEGIN
IF ( RCADATAEV >= DATARIF ) THEN
RTIPOCITTAD = 1501; /* RESIDENTE */
ELSE
RTIPOCITTAD = 0;
END
END
END
Ciao,
Marco