> I think that I failed to mention that this query gets executed thousands
of
> times, and without using paremeters the query is prepared each time it is
> executed, when it really only needs to be prepared once.

It seems I misunderstood your intention... I thought you were driving the
selection
filter from another query to supply the :p_cell_id and generate new
:p_new_cell_id
and :p_to_id values... The preparation of the query occurs once... The
assignment
of parameter values occurs as often as you want to change them.  What have I
missed.

SQL.Text := QRY_InsertSomething;
Prepare;
while not LQuery2.EOF do begin
     // Set up parameters;
     ParamByName['p_new_cell_id'].AsString := '1';
     ParamByName['p_to_id'].AsString := '13';
     ParamByName['p_cell_id'].AsString :=
         LQuery2.FieldByName('cell_id').AsString;
    ExecSQL;
    LQuery2.Next;
end;
Unprepare;

That's only 1 prepare...

NB: Note the string specification... I'm assuming since your filter is a
string that the parameters going in are strings too... This could be the
problem with the query... is cell_id a string or a number?

--
Aaron Scott-Boddendijk
INTAZ Limited
+64 7 838 3371 Voice
+64 7 838 3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to