Subject Re: [IBO] Prepare confusion
Author Jason Wharton
Frank's advice is correct. He pointed to the IBO way of handling
customization of the WHERE clause but you are also at liberty to simply swap
it out with a new one and the dataset should respond appropriate for you
without having to do an Unprepare/Prepare. You may want to do a Close;
change where clause (using beginupdate and endupdate) and then Open the
dataset. It may actually even just refresh it automatically if you change
the where clause while the dataset is active.

Jason Wharton
CPS - Mesa AZ

-- We may not have it all together --
-- But together we have it all --

----- Original Message -----
From: "Frank Ingermann" <frank@...>
To: <>
Sent: Tuesday, August 20, 2002 5:49 PM
Subject: Re: [IBO] Prepare confusion

> Hi Scronkey,
> Scronkey wrote:
> > Hi there.
> >
> > I'm still a little confused about the use of prepare/unprepare.
> > Are these only needed on paramterized queries?
> >
> > My scenario is that I have a query which most of the time uses one
> > where clause, but occasionally I need to do a sqlWhere.Clear and use
> > a different where clause.
> > Do I need to unprepare/prepare in this case?
> >
> > I am finding that it works fine without using prepare at all, but
> > I'm not sure if it is correct (ie speed)
> >
> > When is an unprepare explicitly needed? Always before a prepare?
> >
> > Thanks for any info.
> > Rgds,
> > -Ryan
> as long as it's just the *params* in the Where clause you want to change,
> won't need unprepare/prepare (from the top of my head, a simple Refresh
> do - not certain though atm). To make a whole new Where clause do an
> InvalidateSQL/Refresh on your query and clear/feed the SQLWhereItems in
> OnPrepareSQL event.
> in general, prepare/unprepare is somewhat "expensive" so avoid it if you
> hth,
> fingerman
> --
> -------------------------------------------------------------------------
> when parsers parse, and compilers compile, then why don't objects object?
> fingerbirdy - fingerman's door to Firebird