procedure TForm6.Update_Select_Income;
begin
Select_Income.First; //make sure, it's the first record
while not Select_Income.EOF do
begin
query.First; //make sure, it's the first record
while not query.EOF do
begin
if ((Select_Income.FieldByName('income_category').AsString) = (query.FieldByName('income_category_name').AsString)) then
begin
Update_Income.Close;
Update_Income.Params.BeginUpdate;
Update_Income.Params.ParamValues['income_order']:= Select_Income.FieldByName('income_order').AsString;
Update_Income.Params.ParamValues['income_category']:= query.FieldByName('income_category_id').AsString;
Update_Income.Params.EndUpdate;
Update_Income.ExecSQL;
end;
query.Next;
end;
Select_Income.Next;
end;
Tansaction.CommitRetaining; //you need a transaction, to commit the changes
ShowMessage('Success!');
end;
If the params are correct this should work! Any exception raised? ShowMessage is displayed?