I have a local File Geodatabase that I need to query a TABLE and append those records along with ATTACHMENTS to an Oracle DB SDE.
I would rather hit the Service directly using edit_features , but if its easier to hit the db directly I can go that route. The big issue is that I NEED the attachments to come along with the TABLE values.
I have done this before but that was reading JSON files that I scraped from a Service and Attachments were NOT needed... SO I think a different approach is warranted.
for x in os.listdir(path):
if x.startswith("output"):
filetoImport = path + x
f = open(filetoImport)
data = json.load(f)
featureAddingAdd = data['features']
add_result = ports_layer.edit_features(adds = featureAddingAdd)
QUESTION:
I guess the basic question is whats the BEST way to query a Local File Geodatabase with a WHERE CLAUSE to get specific records from a TABLE and then add those TABLE records and ATTACHMENTS to an Enterprise DB via REST API 'edit_features'
Hi @kapalczynski,
How does this workflow suit your needs (using ArcPy)
1. Select by Attributes of your Table.
2. Use the ArcPy Append tool (only selected features from step 1 will be appended). The target is your Table URL - set to maintain attachments (although In think it does this by default)
My preference is to use ArcPy to append to the Table in the Enterprise Geodatabase, but appending to the Service will work too.
All the best,
Glen