1

I have a table that contain several columns, each has their own data. then, someone have made some change in the data (just a little one data editing). how do i know later what data have been edited/changed using MapInfo SQL Query? thanks.

  • You would have to refer to a backed up version of the table. Assuming you have a backup then if you loaded the backup and current version of the table you could do something like select * from <currenttable>,<backuptable> where <currenttable>.<uniquekey> = <backuptable>.<uniquekey> and <currenttable>.<col1> <> <backuptable>.<col1> into selection. Once you've got the syntax down you could create a MBX file to iterate through the columns. Other than that MapInfo doesn't do versioning in the same way that ArcSDE does for example. – Mark Sep 3 '13 at 10:59
  • Mark, you should write this as an answer – Peter Horsbøll Møller Sep 3 '13 at 11:26
  • If you happen to have your table connected to a database, you could let the database handle the versioning. Have a trigger create copies of the records when they get changed – Peter Horsbøll Møller Sep 3 '13 at 11:28
  • Sir, what do you mean by "<currenttable>.<col1> <> <backuptable>.<col1>"? – hairu Sep 4 '13 at 2:26
  • @hairu this is a comparison between the contents of col1 in the backed up version of the data against the same column in the current version of the data - the <> equates to "not equal to". So if the table was named myDataset, ID was a primary key and the first column that you're interested in is address you're query may look like "Select * from myDataset, myDataSet_backup where myDataSet.ID=myDataSet_backup.ID and myDataSet.Address <> myDataSet_backup.Address into selection". The selection would then contain records where the feature is the same between the 2 tables and address has changed – Mark Sep 4 '13 at 7:00
1

You would have to refer to a backed up version of the table. Assuming you have a backup then if you loaded the backup and current version of the table you could do something like

select * from <currenttable>,<backuptable> where <currenttable>.<uniquekey> = <backuptable>.<uniquekey> and <currenttable>.<col1> <> <backuptable>.<col1> into selection 

Once you've got the syntax down you could create a MBX file to iterate through the columns. Other than that MapInfo doesn't do versioning in the same way that ArcSDE does for example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.