Subject | Re: [firebird-support] Examples of using cyursors within stored procedures |
---|---|
Author | Helen Borrie |
Post date | 2004-03-16T08:15:24Z |
At 09:54 AM 16/03/2004 +0200, you wrote:
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
>I would like tro ask if one or more cursors can be used within storedThe "advertised" way is as Thomas S. explained (but omit the Suspend if
>procedures and if so if there are any examples of using this.
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