By David Crowther
Is it possible to edit attributes in MapThat to use an Apostrophe?
This depends on the source of the data being used. In this case we will assume that the source data is stored in a SQL Database.
Here we have a Wards Table for Liverpool where none of the records currently have an apostrophe in any of the columns.
When viewed in the Data Table in MapThat the same attribute values are shown:
We will now try to add an Apostrophe into one of the records using SQL Management Studio. Using the update statement below returns an error message, which is the first indication that SQL has restrictions with the use of Apostrophes.
In fact to successfully insert an Apostrophe into a record in SQL you need to demote the Apostrophe twice. Here is the correct update statement example:
Now the record is successfully updated in the SQL Database table with the Apostrophe added to the Name field.
And MapThat will successfully show the Apostrophe as part of the record.
What happens when we try to edit this record using MapThat?
Well if we simply use the Edit Attributes button in the Data Table to change the attributes for any of the other records e.g. changing the Ward Name of ANFIELD to be CADLINE, that record is successfully amended.
If we press Save the SQL Database Table is amended with the edits that we made in MapThat.
However, if we try to amend an attribute in the record that contains an Apostrophe e.g. changing the Ward Name for CROXTETH to be DAVID, we receive an error message as the whole record is being updated into SQL and the single Apostrophe in the Councilors name causes a syntax error.
So – is it actually possible to edit attributes in MapThat where a record has an Apostrophe within it?
The answer is Yes – we can use the Edit Attributes Form within the MapThat Drawing Tools. To do this, from the Edit Tools, choose the Drawing Tools and choose to edit the Liverpool Wards layer.
Now in Edit mode, we can use the Edit Attributes Form….
and make a change to this individual record - for example making a change to the Ward Name changing Croxteth again to David.
Note - that the Edit Attributes form has automatically removed the Apostrophe from within the Councillors Name!
Once we press Save the edit is successful and if we look in the SQL Database table we can see that we have made the change to the Ward Name to be David. However, as we noticed before, using the Edit Attributes Form has now removed the Apostrophe from the Councillor Name field.
So, finally is it possible to make the changes to a record that has an Apostrophe and also retain the Apostrophe in the record – or indeed add an Apostrophe?
Yes – using the Edit Attributes Form we can insert or re-insert an Apostrophe by using two Apostrophes – the same as we would in our earlier SQL Update statement. Now below in the Edit Attribute Form we have inserted an Apostrophe twice in the Ward Name and twice in the Councillor Name.
If we now press SAVE the edit is successfully made.
And if we check the record in our SQL Database Table we can see the Apostrophe’s have been added.
So, it’s up to you!
MapThat can show Apostrophes in records. It can also allow you to add, remove and retain Apostrophe’s, but you may feel it’s easier to simply remove these from your SQL tables to reduce any possible confusion for your Users.