Subject | Re: [IBO] Prepared and unprepared |
---|---|
Author | Tim Ledgerwood |
Post date | 2003-06-30T09:21:09Z |
>Did you realise this is a completely unnecessary consumption ofOK - if I understand you correctly, I could accomplish the same by doing
>resources? If the only thing in your query that changes is the value of
>the parameter(s) then you only have to call Refresh. The query stays both
>active and prepared.
the following :
with MyQuery do
begin
//Leave out the "If Active" statement
ParamByName('XYZ').AsSomething := varXYZ;
if not prepared then prepare; //prepare if not prepared already
Open;
end;
With queries where the SQL changes, I could do the following :
with MyQuery do
begin
If Active then Close;
SQL := 'some SQL string';
ParamByName('XYZ').AsSomething := varXYZ;
if not prepared then prepare; //prepare if not prepared already
Open;
end;
Thanks a mill to all, btw.
(Its all my D1 and D2 with Sybase coming out ... :-))
Tim
[Non-text portions of this message have been removed]