Can ArcMap support self-references with references?

4170
1
10-30-2014 05:06 PM
BryanHall
New Contributor II

My source data has several tables that have 3-4 levels of hierarchical data using self-references (parent-id to pk).

In ArcMap 10.x is there a way to create a reference that self-references the same table?

Thanks,

Bryan

0 Kudos
1 Reply
RichardFairhurst
MVP Honored Contributor

Self-Relates or Self-Joins are not possible for feature classes or tables directly to themselves.  However, for a standalone table an Event layer (XY or Route Event Layer) created from the table can be related or joined back to the table that created it, since the Event layer exists in memory with a different schema (at least an additional shape field).  So even if a table had no XY coordinates in it, any numeric field could be used as fake XY values to generate an XY Event layer for the purposes of a self-relate.

You cannot relate a feature class to itself even when you add the feature class in multiple layers with different layer names and settings and you cannot use the Event layer tools that work with tables.  However, for a feature class (and a standalone table) you can use the Create Query Table tool to generate an in memory layer from the feature class and perform a self-relate to the Query Table output.  I prefer the XY and Route Event layers over a Query Table, because XY and Route Event layers are editable and respond to edits in the source table, while a Query Table cannot be edited and will not respond to edits in the source feature class or table.  For SDE databases some other tools (Create Query Layer) may have the same effect.

0 Kudos