I am using ArcGIS for Desktop 10.2. Am I correct in understanding that ArcGIS will only let you select an integer or text fields as the "key" ID when adding a query layer? Our Oracle enterprise DB mistakenly used NUMBER(22), Data Type: FLOAT, as unique identifiers even though the IDs are all whole numbers; however, I seem unable to select the 'number' fields as keys. It will allow me to select integers and text (I guess you can combine a number with text to make a unique identifier). I've tried CAST-ing them as integers in the query but the queries are crashing ArcGIS and I'm trying to figure out whether there is any way around the CAST statement to see if that is the problem.
2 Answers
All ArcGIS query layers require a "unique identifier" to link features in the map canvas to table rows (this allows graphical feature selection to highlight a row in the UI, or selection of a row in the UI to highlight a map feature). The "rowid" column required for ArcSDE-registered views in enterprise geodatabases is limited to integers, but Query Layers are more forgiving -- quoting the online documentation:
To be used as a unique identifier in ArcGIS, a field must be not null, contain unique values, and be one of the following data types:
- integer (positive values only)
- string
- GUID
- date
Real (floating-point) values cannot be used because equivalence assertions can fail due to storage representation complications.
-
Thanks! I will add that the problem is version specific. I also added the version of the software that I am using to my question. I am stuck with 10.2 for the moment. Dec 14, 2015 at 17:36
-
-
Yes, I was working on a query to transfer the information from the enterprise DB to the SDE. Dec 14, 2015 at 18:30
In ArcGIS 10.2.* or earlier, If ArcGIS won't let you select the floating point field you want, then there is no way you can use that field as a unique identifier, except to CAST the data as an integer in the query.
NUMBER(38)
, orNUMBER(6)-NUMBER(10)
. Rowids can never be real or text.DESCRIBE
output), the column name which you wanted to use, and a screenshot of the issue, then it's unlikely you would have received a request for more information.