AnsweredAssumed Answered

Updating Geo-Database 

Question asked by nikfal on Nov 29, 2017
Latest reply on Nov 30, 2017 by nikfal

I need to update a point map on my SQL Geo-database based on the selected point on Map View. To do So, I created a simple Python script as follows and shared it as a service:

import arcpy

inputLong = float(arcpy.GetParameterAsText(0))
inputLat = float(arcpy.GetParameterAsText(1))
xy = [(inputLat, inputLong)]

fc = r"Database Connections\Connection to XXX-XXXXX.sde\A.DBO.CropPoint102100"
cursor = arcpy.da.InsertCursor(fc, ["SHAPE@XY"])
for row in xy:
    cursor.insertRow([row])
del cursor

  You can easily run it and add the new point on "ArcGIS REST Services Directory" as follows:

Unfortunately, I cannot Execute the task in my code as follows:

 var gpUrl = "http://XXX-XXXXX:6080/arcgis/rest/services/Script102100/GPServer";
var gp = new Geoprocessor(gpUrl);
var params1 = {
               Longitude: -101.35,
               Latitude: 35.6};
gp.submitJob(params1).then(console.log("OK"));

After running the code, I get the "OK" on the browser log but the point map is not updated. Anybody knows what's going on?

Outcomes