I want to add up all values in the table each record, encryption, to generate an encrypted string,
So you ask how many records are generated, how many insert at the end of the string of new fields,
How to carry on the batch operation to cycle on the table? Because I can't see how to write, behind the where
So do not know how to start,
CodePudding user response:
You can every time a record to add up all the values, encryption, generate an encrypted stringThen iterate through all the records add up the string
Such as the original field a, b, c for the new d
STR:='select a, b, c, d (a + b + c) as the from XXX'
ADOQuery. SQL. The add (STR);
ADOQuery1. Oepn;
StrAdd: string; You finally get that all the records of new field
While not ADOQuery1. Eof do
The begin
StrAdd:=strAdd + FieldByName (' d '). Asstring;
next;
end;
I wrote it was a careless should be able to understand
CodePudding user response:
You may not know what I mean, I mean, each record to generate a string, inserted behind when the record of the new field, if there are 100 records, will generate 100 string, is much more behind each record a value (add up when the records generated string)CodePudding user response:
Update the set d=(a + b + c) from the tableCodePudding user response: