Select to view content in your preferred language

arcpy: How to select missing records in a related table??

937
1
Jump to solution
10-31-2018 09:08 AM
StudentFernie
Occasional Contributor

ok so here is my deal; I am working in an SDE, I have a feature Class of civic address points and these points have a one to many link table also in the SDE. This table is linked by a roll number.  Some points are not in the table and some table records are not in the points.  What I want top do is have a script that selects all the related records in the link table, switch the selection so the script will then print the non related records by their unique identifier. The purpose of this is to find what records in the link table require points and vice versa. 

I need help finding a way to select what records have a relationship.

Ive tried all of these and many more but I cant figure it out: 

enterprise geodatabase - Efficiently selecting related records using ArcPy? - Geographic Information... 

Select Related Records 

https://tutel.me/c/gis/questions/50287/efficiently+selecting+related+records+using+arcpy 

What I basically want to do is utilize something like that nice little Select related records button in the attribute table but in python. The reason I require this script is so less "GIS savvy" people in the organization will be able to track down this missing information. 

all help and assistance is greatly appreciated

thank you. 

0 Kudos
1 Solution

Accepted Solutions
StudentFernie
Occasional Contributor
#SOLVED WITH THIS SCRIPT 
enterprise geodatabase - Efficiently selecting related records using ArcPy? - Geographic Information... 
its the big one at the bottom of the page.
IF YOU ARE LOOKING, SIMPLY ADD YOUR FEATURES AND TABLES TO THE VARIABLES
ON A FURTHER NOTE, I AM WORKING IN A VERSIONED ENVIRONMENT SO I HAD TO USE BOTH: 
arcpy.MakeFeatureLayer_management and arcpy.MakeTableView_management to accompany my script. 
I am so happy with this and must thank the people who wrote this:  
from here i was able to switch the selection to show my non connected records and print them, the next step 
is to have it export to an excel sheet. so exciting!! 

View solution in original post

0 Kudos
1 Reply
StudentFernie
Occasional Contributor
#SOLVED WITH THIS SCRIPT 
enterprise geodatabase - Efficiently selecting related records using ArcPy? - Geographic Information... 
its the big one at the bottom of the page.
IF YOU ARE LOOKING, SIMPLY ADD YOUR FEATURES AND TABLES TO THE VARIABLES
ON A FURTHER NOTE, I AM WORKING IN A VERSIONED ENVIRONMENT SO I HAD TO USE BOTH: 
arcpy.MakeFeatureLayer_management and arcpy.MakeTableView_management to accompany my script. 
I am so happy with this and must thank the people who wrote this:  
from here i was able to switch the selection to show my non connected records and print them, the next step 
is to have it export to an excel sheet. so exciting!! 
0 Kudos