Queries using GUID fields - strange behavior

3232
1
12-22-2015 04:41 PM
MichaelDavis3
Occasional Contributor III

We are using GUID fields in one of our new apps to store primary/secondary keys.  In the past we've used GUID/UUID but stored them in plain old text fields.

When querying this data in the ArcGIS Runtime using an AGSQuery object we are running into some strange behavior.

If we select a GUID field out as an NSString or NSUUID object it returns something like this:

9f6d8cac-19b4-4e24-af96-4654aac8287e

Note that this is not quite the same as GUIDs when viewed in ArcGIS - they don't have the curly brackets {}.  The strange thing is that if I then try to use this value in a query, say to get all records for a feature with this primary key, I have to manually add the brackets back in like so:

    query.whereClause = [NSString stringWithFormat:@"SurveyID = '{%@}'",[self.surveyID uppercaseString]];

Note that in addition to manually adding the curly brackets back in, I've also had to convert the string to upper case.  If I don't do this I have to use the LIKE operator instead of =.

Any idea why GUID fields are behaving so strangely?  I'm worried that records I create in the mobile app using a new UUID (iOS version of GUID) won't check in correctly, or the value will be altered when checked in.

Any ideas why the query behavior of this data type is so inconsistent?

Tags (3)
0 Kudos
1 Reply
DiveshGoyal
Esri Regular Contributor

Thanks for reporting. We've taken note of this and will let you know when we look into it.

0 Kudos