Subject Re: [ib-support] CURSOR or WHERE CURRENT OF in a stored procedure
Author Dimitry Sibiryakov
On 5 Jun 2003 at 10:26, Martijn Tonies wrote:

>DELETE FROM MyTable ... WHERE CURRENT OF MyCursor;
>
>But I don't understand it's functionality :-/

A bit abstract example:

FOR SELECT .... DO
IF (<very complex condition that can't be used in WHERE clause>) THEN
DELETE .... WHERE CURRENT OF ...;

More useful example by Dmitri Popov - INSERT_OR_UPDATE:

AValue = NULL;
FOR SELECT PK_Field FROM ATable WHERE ... INTO :AValue
AS CURSOR TmpCursor DO
UPDATE ATable SET .... WHERE CURRENT OF TmpCursor;
IF (AValue IS NULL) THEN
INSERT INTO ATable ....;

SY, Dimitry Sibiryakov.