Home > Back-end >  Data records to find
Data records to find

Time:09-20



Function is roughly like this: in order to sign up for a update log, which line of what is the content of the log data update,

Such as I have above the dataview now call it A table A, and then make A copy of it to come out now, call table B,
Then I to update data in table B (modify data only, do not add or delete rows or columns), in addition to the MC that do not modify A list of data, other data may change, modify finished, I want to do an update log, as long as A certain lines of data had changed, and A, the table is not the same, just the lines of the MC and modify the content of the records and can find out,

PS: before I had a similar requirement, there were only two columns, so I used the TDictionary structure, but it can only be recorded and find two string data,
 
NewList:=TDictionary . Create;
OldList:=TDictionary . Create;


Now you need to record more than two data, you have what good method? Use Tstring or other something to record for the data structure,




CodePudding user response:

For this list, add a temporary field, type bit, so, after reading data, the field to False:
1, new lines, the bank's temporary field to True;
2, after modification, the bank's temporary field to True;

Print the table, when the bank's temporary field to True, print,

CodePudding user response:

reference 1st floor lyhoo163 response:
for this list, add a temporary field, type bit, so, after reading data, the field to False:
1, new lines, the bank's temporary field to True;
2, after modification, the bank's temporary field to True;

Print the table, when the bank's temporary field to True, print,


Line 1, the operation will not increase
2, modified temporary field is true, now I just don't know how to judge the line data has been modified,,,

CodePudding user response:

Monitoring data changes to the database is more efficient, with a trigger for instance, the CDC function, if you use a quick query contrast methods to monitor, only need intermediate variable to the staging, common string, integer variables can ah, complicated record types can be used, or declare a class with an array or list management,

CodePudding user response:

If you C/S mode, you can use the ClientDataSet Delta, recorded the data of change,
  • Related