Subject Re: [firebird-support] Examples of using cyursors within stored procedures
Author Helen Borrie
At 09:54 AM 16/03/2004 +0200, you wrote:
>I would like tro ask if one or more cursors can be used within stored
>procedures and if so if there are any examples of using this.
The "advertised" way is as Thomas S. explained (but omit the Suspend if
your cursor processing is performing DML, rather than returning a virtual
table).

You can also have a more MSSQL-like cursor this way:
DECLARE VARIABLE a integer;
DECLARE VARIABLE b integer;
....
BEGIN
...
FOR
SELECT a, b
FROM atable
FOR UPDATE
INTO :a, :b
AS CURSOR pdq
DO
BEGIN
update atable set ... where current of pdq;
...
END
...
END ^

Just don't learn to love it too much, though. Dmitry Y has reimplemented
it completely for Firebird2. I can't say whether the existing
(undocumented) syntax will continue to be supported.

/heLen