ArcGIS 10.2.2 – Definition Query Expression Limits

arcgis-10.2arcgis-desktopdefinition-querylimitations

I have a large database in ArcGIS 10.2.2, with over 2 500 000 point vectors. Each point has a unique number code.
I want to spatially subset my data, so that I can extract only points with a specific codes.
I tried to use an expression build by me, but in the Definition Query, i am limited to a certain number of characters. I want to subset points from over 200 000 unique codes.

The codes are numeric. Here is a sample code:

IdRPL in (1607130,1607131,1609481,1609482, ....., 1709809) 

Best Answer

If you have the unique IDs in an Excel file, you can join this file to your points feature class and then query on the joined file. See Esri's information on joining Excel files to feature classes.

Say that your feature class has a field IdRPL, and your Excel file has IDs in a field called UniqueID.

  1. Right-click on your feature class and choose Joins and Relates/ Join...
  2. Choose Join attributes from a table
  3. Choose the field in this layer that the join will be based on: IdRPL
  4. Choose the table to join to this layer: (select your Excel file)
  5. Choose the field in the table to base the join on: UniqueID (or whatever column name you used in Excel)
  6. Join Options: Keep only matching records

In the sample below, the "matching records" would be only those five records that don't show 'null' in the Excel file. The three null records do not exist in Excel, so they will not display in the layer.

enter image description here