Subject Re: [IBO] TIB_Cursor not returning correct result
Author sgharp
--- In, Helen Borrie <helebor@t...> wrote:
> At 03:24 PM 25/08/2004 +0000, you wrote:
> >Hi All,
> >
> >I have a strange problem that's got me stumped. I'm executing a
> >stored procedure that populates some fields in a table. Next, I'm
> >using a TIB_Cursor to query a numeric field in the table. The
> >is returning a zero which is incorrect.
> >
> >Now the kinky part. I can stop the debugger (breakpoint) as soon
> >the query returns the zero and cut and paste the SQL statement
> >IBExpert and execute it. The query executed in IBExpert returns
> >14.09 which is correct.
> >
> >The stored procedure mentioned above empties the table and then
> >populates it with calculated values. It works fine and generates
> >the numbers correctly. I don't understand why the TIB_Cursor
> >return a different result than IBExpert with exactly the same
> >at the same point in time.
> You aren't meant to call Open on TIB_Cursor, since nothing will
> until the first Fetch is called. Open is a method of the dataset
> buffer. TIB_Cursor doesn't have one.
> Always call First to "open" a TIB_Cursor. Then it will shout down
the wire
> at the SP "send me what you're holding for me over there." While
the TIB_C
> is busy doing its thing with that row, the SP will resume
executing and
> generate another row.
> The same holds for TIB_C's over real datasets. Call First to get
a row,
> then call Next to get another one.

Thanks Helen but that didn't do it. I changed the code to


and it still returns zero. Do you have any other ideas? BTW, I use
TIB_Cursor in several places and haven't ever seen anything like