Subject | Advice |
---|---|
Author | Robert martin |
Post date | 2004-08-12T03:25:57Z |
Hi All
I want to replace some OLD BDE / DBase code like this... (rough example
with Table
First;
while (Eof = False) do begin
if (Source.Locate('aRef', FieldByName('ARef').AsInteger, []) = True) then begin
Delete;
end
else begin
Next;
end;
end;
end;
I had thought of something like this
AnUpdateQuery.SQL.Text = 'DELETE FROM Table WHERE aRef IN (SELECT ARef FROM Source)';
AnUpdateQuery.ExecSQL
However I suspect the performance of the above SQL will be horrible. You can't do JOINs in Delete statements so what would be the most appropriate / best performance method of achieving this result?
Rob Martin
Software Engineer
phone 03 377 0495
fax 03 377 0496
web www.chreos.com
[Non-text portions of this message have been removed]
I want to replace some OLD BDE / DBase code like this... (rough example
with Table
First;
while (Eof = False) do begin
if (Source.Locate('aRef', FieldByName('ARef').AsInteger, []) = True) then begin
Delete;
end
else begin
Next;
end;
end;
end;
I had thought of something like this
AnUpdateQuery.SQL.Text = 'DELETE FROM Table WHERE aRef IN (SELECT ARef FROM Source)';
AnUpdateQuery.ExecSQL
However I suspect the performance of the above SQL will be horrible. You can't do JOINs in Delete statements so what would be the most appropriate / best performance method of achieving this result?
Rob Martin
Software Engineer
phone 03 377 0495
fax 03 377 0496
web www.chreos.com
[Non-text portions of this message have been removed]