Subject Re: [firebird-support] DECLARE MyCursor CURSOR
Author Robert Meyer
Helen,

OOPS, sorry, you do cover named CURSORs in PSQL. You do have many "Not in
the scope of this book" type statements. I thought I read it regarding
CURSORs somewhere, but not going to take the time to look ( too many pages
:), not for the book, but to find that one statement ).

The named CURSOR currently implemented in PSQL doesn't use the DECLARE,
OPEN, FETCH, and CLOSE statements and is restricted to the scope of that
trigger or procedure. I hope, if DECLARE, OPEN, FETCH, and CLOSE are
implemented in PSQL, it will allow such to be spread across multiple stored
procedures. Meaning the scope of a DECLAREd CURSOR is within a TRANSACTION
not within a TRIGGER or PROCEDURE.

Bye the way, your book is excellent.

Regards,

Robert

----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, October 07, 2004 8:52 AM
Subject: RE: [firebird-support] DECLARE MyCursor CURSOR


>
> At 05:15 PM 7/10/2004 +0200, you wrote:
>
> > > Thanks for your answer, but to which question are you answering?
> > >
> > > Can one DECLARE, OPEN, FETCH, and CLOSE a CURSOR in one stored
procedure?
> > > If so, how? Using IBExpert, I can't seem to DECLARE a CURSOR, much
less
> > > OPEN, FETCH, and CLOSE it?
> > >
> > > In Helen Borrie's book, she keeps saying that CURSORs are beyond the
scope
> > > of her book. Are CURSORs beyond the scope of Firebird too?
> >
> >Robert, if you don't own the InterBase 6 Beta documentation set
> >or one of the manuals available on the IBPhoenix CD, then get
> >in touch with Firebird Stored Procedure and Triggers here:
> >http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_intro_sp_trig
>
> Umm, if he has the Firebird Book, it's hardly worth the trouble. TFB has a
> complete Part (5 chapters) devoted to them.
>
> The extent to which it is possible to use cursor sets in PSQL is fully
> covered there - including the (otherwise) undocumented use of a named
> cursor in a FOR..SELECT...FOR UPDATE INTO <vars> AS CURSOR <Cursorname>
> statement. :-) (Sorry, Carlos, but there **is** more than one way to zap
> through a select set in a SP).
>
> All that DECLARE CURSOR, SET CURSOR and so on stuff is available in
> embedded SQL, a branch of Firebird that isn't covered in TFB.
>
> I believe named cursors with real guts are coming in Firebird 2, though I
> don't have any details yet about syntax or usage. It would be nice if one
> could pass a cursor as a parameter in an embedded procedure call, or
return
> one in RETURNING_VALUES, but this is wishful thinking on my part at the
moment.
>
> ./heLen
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>