1

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
    Please edit the question to explain what you mean by "index" (since, in context, it has little to do with the way database indexes work). It would also help if you use concrete examples and explicitly describe what "crashing ArcGIS" means. You should also specify the database, e.g. Oracle 11.2.0.4 – Vince Dec 14 '15 at 14:54
  • "Index" in the context of a database means a never-changing field that is used to identify unique records. When you add a query layer, ArcGIS asks you to select a key field to index on. ArcGIS only lets you select from certain fields to index, which appear to be text and integers. The field which our DB uses which is common to all tables is a real number field and does not show up for selection. – Nick D'Amato Dec 14 '15 at 15:51
  • "Crash" means the software winks out with no message, but all i want to know at this time is if there is another way to select a real number field as the key index field. I don't really care about the crash, since there is absolutely no way for anyone to diagnose that on-line. – Nick D'Amato Dec 14 '15 at 15:54
  • 1
    A rowid column is not an index, per se, just an integer value which uniquely identifies a row. In Oracle, it could be NUMBER(38), or NUMBER(6)-NUMBER(10). Rowids can never be real or text. – Vince Dec 14 '15 at 15:57
  • 1
    "Index" has a very specific meaning with respect to databases. If you avoid explaining the problem fully, then you also avoid the opportunity to find the answer while researching the question. If you had provided the releases of software involved, the table definition (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. – Vince Dec 14 '15 at 16:54
2

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. – Nick D'Amato Dec 14 '15 at 17:36
  • Actually, it's only ArcSDE that requires integer rowids. Query Layers have always permitted the listed types (as per the 10.0 doc) – Vince Dec 14 '15 at 18:24
  • Yes, I was working on a query to transfer the information from the enterprise DB to the SDE. – Nick D'Amato Dec 14 '15 at 18:30
1

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.

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.