All,
How do I run functions such as the select by attribute (arcpy.management.SelectLayerByAttribute) on a feature class in an enterprise geodatabase via Jupyter in Arc Pro? I can run functions via Jupyter on shapefiles and regular geodatabase but not on enterprise geodatabase. For now i just poking around Jupyter Notebooks, but any future applications of the Notebooks must be capable of using data from our enterprise geodatabase.
Arcpro: 2.7.1
Thank you
Solved! Go to Solution.
Hi Laura,
Get the path to the Enterprise geodatabase .sde file. Example below.
import arcpy
arcpy.management.SelectLayerByAttribute(r"C:\pathtodatabase.sde\featureclass", "NEW_SELECTION", "NAME = 'Bob' And AGE = '30'", None)
Hi Laura,
Get the path to the Enterprise geodatabase .sde file. Example below.
import arcpy
arcpy.management.SelectLayerByAttribute(r"C:\pathtodatabase.sde\featureclass", "NEW_SELECTION", "NAME = 'Bob' And AGE = '30'", None)
Thank you, I will try it out as soon as I get the chance.
Davin,
How do i get the the path to the Enterprise geodatabase .sde file? For now I do not necessary need to do this in python/Juypter but being able to have a script that can run on mutable computers wold be nice.
Thank you,
If it is ArcMap, they are located in
C:\Users\<username>\AppData\Roaming\ESRI\<Desktop10.x>\ArcCatalog
If they are Pro... they are stored in the project so they will be wherever that project is saved.
To get around Pro's isolationism, I created a folder that is accessible to everyone and keep the common connection files in it.