Subject RE: [IBO] check for empty dataset
Author Helen Borrie
At 08:20 PM 27/07/2004 +0000, Ronan van Riet wrote:
>Thanks Paul for your reply!
>
>Is it necessary to close the IB_Cursor before preparing it?
>I am executing the IB_Cursor, rather than opening it. What is the
>difference?

You don't open and close datasets formed by ib_cursors, because they are
unbuffered. Execute is OK if you are using an ib_cursor to execute a DML
statement, including an executable SP that returns a single set of return
values. For ib_cursors on SELECT statements, always call First to begin
fetching.

> > if not MyCursor.Prepared then MyCursor.Prepare;
> > // don't Open a cursor; (API)First will "open" it:
> > MyCursor.First; // or, faster:
> APIFirst <<<--------------------------------------
> > if MyCursor.Eof
> > then ... // dataset was empty
> > else ... // dataset contains at least one record

Helen