Subject | Re: [IBO] Prepare confusion |
---|---|
Author | Jason Wharton |
Post date | 2002-09-05T23:35:29Z |
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.
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
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.
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
----- Original Message -----
From: "Frank Ingermann" <frank@...>
To: <IBObjects@yahoogroups.com>
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,
you
> won't need unprepare/prepare (from the top of my head, a simple Refresh
should
> 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
the
> OnPrepareSQL event.
>
> in general, prepare/unprepare is somewhat "expensive" so avoid it if you
can.
>
> hth,
> fingerman
>
> --
> -------------------------------------------------------------------------
> when parsers parse, and compilers compile, then why don't objects object?
>
> fingerbirdy - fingerman's door to Firebird
> http://www.fingerbird.de