Subject [IBO] Re: TIB_Cursor not returning correct result
Author sgharp
--- In IBObjects@yahoogroups.com, Lucas Franzen <luc@r...> wrote:
> Steve,
>
>
>
> > Interesting that you suggest removing the qry.First. Helen told
me
> > to replace the qry.Open with the qry.First because, according to
> > her, the Open method doesn't cause a fetch.
>
> No, she didn't.
>
> She said/wrote: Use FIRST with a TIB_Cursor and OPEN with a
TIB_Query.
> You used a TIB_Query and did both.
> (Maybe the confusing part is that you wrote you're using a cursor
and
> named it qry...)
>
> >
> > Here's the update procedure.
> >
> > create procedure spUpdateAveIdealUsage(iInvItemID BigInt, dUsage
> > Double Precision)
> > as
> > Begin
> > update xInvItem
> > set Cycle3Ideal = Cycle2Ideal,
> > Cycle2Ideal = Cycle1Ideal,
> > Cycle1Ideal = AveIdealUsage,
> > AveIdealUsage = :dUsage
> > where (InvItemID = :iInvItemID);
> > End
> >
> > I've tried the same process using an existing TIB_Query instead
of
> > creating dynamically and I get the same results.
>
> Now I'm confused.
>
> You open a Query and when it's empty you do an update.
>
> If I understood that one right then what's the problem?
>
> That you don't see the updated values within the Query???
>
> You can't without Re-Opening or refreshing it.
>
> Please enlighten me.

You've lost me completely. I'm doing an update when the query is
empty? Where did you get that? The problem is the same as it's
been from the beginning. Either using a TIB_Cursor or a TIB_Query,
the result set is incorrect in my application but correct in
IBExpert.

I think I'll put this whole process into a stored procedure and
negate the need for a cursor or query. I probably should have done
that in the beginning.

Thanks for you help,
Steve