POST
|
I updated line 40 in the code above insValues = [u'W.285489', u'Roy P.', None, 88.2, datetime.datetime(2015, 2, 19, 0, 0), None, None, 50, u'11:55 AM', u'PAVD,VAC', u'Open', u'12:00 PM'] with arcpy.da.UpdateCursor(tablePath, tableFields, lidQuery) as updCursor: for updRow in updCursor: updRow = insValues updCursor.updateRow(tuple(updRow)) and still got the same error. I wonder what's the difference between insertRow and updateRow when I am using the same insValues list. insertRow works fine but not updateRow.
... View more
04-15-2016
07:54 AM
|
0
|
0
|
24
|
POST
|
Here's the entire code as I have progressed so far: import arcpy import os import sys import datetime inputFC = "WLINEVALVE" tableFields = ['LID', 'OperatedBy', 'GPSPositions', 'Turns', 'OperationDate', 'Longitude', 'Latitude', 'HighTorque', 'BeginTime', 'Remarks', 'Position', 'EndTime'] insValues = [u'W.285489', u'Roy P.', None, 88.2, datetime.datetime(2015, 2, 19, 0, 0), None, None, 50, u'11:55 AM', u'PAVD,VAC', u'Open', u'12:00 PM'] try: dbConnection = r'Database Connections\conn.sde' workspace = os.path.dirname(dbConnection) editor = arcpy.da.Editor(workspace) saveEdits = False editor.startEditing(False, True) fcPath = dbConnection + "\\" + inputFC tableName = "ARCFM." + inputFC + "RELTABLE_EVW" tablePath = dbConnection + "\\" + tableName # hardcoding for test lidQuery = "{0} = {1}".format("LID", "'W.285489'") with arcpy.da.SearchCursor(fcPath, ['*'], lidQuery) as fcCursor: try: fcLID = fcCursor.next() # will throw StopIteration if empty if fcLID != None: tableCount = 0 with arcpy.da.SearchCursor(tablePath, ['*'], lidQuery) as tableCursor: for tableLID in tableCursor: tableCount += 1 # if no count, do Insert; else do Update if tableCount == 0: # Insert editor.startOperation() with arcpy.da.InsertCursor(tablePath, tableFields) as insCursor: insCursor.insertRow(insValues) del insValues editor.stopOperation() saveEdits = True else: # Update editor.startOperation() with arcpy.da.UpdateCursor(tablePath, tableFields, lidQuery) as updCursor: for updRow in updCursor: # ALWAYS RETURNS THE ONE ROW THAT I WANTED TO UPDATE OR DELETE updRow = insValues updCursor.updateRow(updRow) # - ERROR # ALSO JUST UPDATING ONE VALUE - SAME ERROR # updRow[0] = 'W.999999' # updCursor.updateRow(updRow) # OR I could deleteRow and then do an insertRow - SAME ERROR # for updRow in updCursor: # updCursor.deleteRow() editor.stopOperation() saveEdits = True else: print 'LID not valid, ignore for now = abort operation' editor.abortOperation() del fcLID except StopIteration: # if no LID in featureclass print 'LID not valid, ignore for now = abort operation' editor.abortOperation() except Exception as ex: print 'Error: ' + str(ex) + ' = abort operation' editor.abortOperation() finally: if saveEdits: print 'Stop Editing and Save' editor.stopEditing(True) else: print 'Stop Editing and Not Save' editor.stopEditing(False)
... View more
04-14-2016
10:44 AM
|
0
|
0
|
24
|
POST
|
I have relatedtable in sde that I want to insert or update/delete a row. I am able to insertRow fine but I am not able to execute updateRow or deleteRow on the cursor. There is always: SystemError: error return without exception set Here's the pertinent part of the code: tableFields = ['LID', 'OperatedBy', 'GPSPositions', 'Turns', 'OperationDate', 'Longitude', 'Latitude', 'HighTorque', 'BeginTime', 'Remarks', 'Position', 'EndTime'] insValues = [u'W.285489', u'Roy P.', None, 88.2, datetime.datetime(2015, 2, 19, 0, 0), None, None, 50, u'11:55 AM', u'PAVD,VAC', u'Open', u'12:00 PM'] if tableCount == 0: # Insert - THIS WORKS FINE editor.startOperation() with arcpy.da.InsertCursor(tablePath, tableFields) as insCursor: insCursor.insertRow(insValues) editor.stopOperation() saveEdits = True else: # Update editor.startOperation() with arcpy.da.UpdateCursor(tablePath, tableFields, lidQuery) as updCursor: for updRow in updCursor: # ALWAYS RETURNS THE ONE ROW THAT I WANTED TO UPDATE OR DELETE updRow = insValues updCursor.updateRow(updRow) # - ERROR # ALSO JUST UPDATING ONE VALUE - SAME ERROR # updRow[0] = 'W.999999' # updCursor.updateRow(updRow) # OR I could deleteRow and then do an insertRow - SAME ERROR # for updRow in updCursor: # updCursor.deleteRow() editor.stopOperation() saveEdits = True As far as I can tell, the updCursor returns what I want - the row that I want to update or delete. But no matter what I do with that cursor, I get Traceback (most recent call last): File "<pyshell#89>", line 1, in <module> updCursor.deleteRow() SystemError: error return without exception set or simply "error return without exception set" What am I doing wrong with the UpdateCursor? (This is ArcMap 10.2.1.)
... View more
04-14-2016
10:26 AM
|
0
|
4
|
2442
|
POST
|
What was the next release of ArcGIS and would this be patched in 10.2.1?
... View more
04-12-2016
02:58 PM
|
0
|
2
|
62
|
POST
|
Robert, you lost me on your reply. I was talking about widget.js,widget.html files that I wrote for my custom widget. Those simply can be copied to the server if I make a change? The only time I would need to re-deploy the web app if I were to (for example) add a new widget, etc.? I am still wondering why a simple change in my widget.js file did not get picked up by the Download.
... View more
11-03-2015
12:59 PM
|
0
|
2
|
24
|
POST
|
That would also include the .js and .html files as well? Just trying to determine the best maintenance workflow.
... View more
11-03-2015
12:38 PM
|
0
|
4
|
24
|
POST
|
I successfully deployed a web app to IIS with a custom widget. But when I make a change to the custom widget using my local Web AppBuilder Dev Edition (in the client\stemapp\widgets\<mywidget> folder) and re-download it, the resulting zip file does not pick up the change. Do I have to re-create the web app from scratch in order to add in the updated custom widget?
... View more
11-03-2015
12:17 PM
|
0
|
6
|
2071
|
POST
|
I believe I solved my issue. It wasn't the web adapter but in setting portal for the WAB. I unregistered WAB and then went through webappbuilder/?action=setportal and put in the http url to portal (as oppose https). When I went to register it to get the AppID, I only added the http://<machine>:3344 redirect. A test app allowed me to add the Web Map with my map service.
... View more
10-30-2015
08:51 AM
|
1
|
0
|
23
|
POST
|
Hi Robert, When creating a new WebApp using Developer Edition, I get this first error upon creation: widget [widgets/HomeButton/Widget] created. SyntaxError: Expected ')' { [functions]: , __proto__: { }, description: "Expected ')'", log: undefined, message: "Expected ')'", name: "SyntaxError", number: -2146827282, stack: "SyntaxError: Expected ')' at b.fromJson ( https://js.arcgis.com/3.14/init.js:220:409 ) at b.contentHandlers.json ( https://js.arcgis.com/3.14/init.js:177:383 ) at s ( https://js.arcgis.com/3.14/init.js:182:59 ) at c ( https://js.arcgis.com/3.14/init.js:66:215 ) at d ( https://js.arcgis.com/3.14/init.js:66:10 ) at callback ( https://js.arcgis.com/3.14/init.js:67:350 ) at Anonymous function ( https://js.arcgis.com/3.14/init.js:185:298 ) at k ( https://js.arcgis.com/3.14/init.js:189:425 ) at m ( https://js.arcgis.com/3.14/init.js:189:357 ) at resolve ( https://js.arcgis.com/3.14/init.js:191:441 )" } then rest of the base widgets get created. When I add the WebMap, I get two errors: SyntaxError: Expected ')' { [functions]: , __proto__: { }, description: "Expected ')'", log: undefined, message: "Expected ')'", name: "SyntaxError", number: -2146827282, stack: "SyntaxError: Expected ')' at b.fromJson ( https://js.arcgis.com/3.14/init.js:220:409 ) at b.contentHandlers.json ( https://js.arcgis.com/3.14/init.js:177:383 ) at s ( https://js.arcgis.com/3.14/init.js:182:59 ) at c ( https://js.arcgis.com/3.14/init.js:66:215 ) at d ( https://js.arcgis.com/3.14/init.js:66:10 ) at callback ( https://js.arcgis.com/3.14/init.js:67:350 ) at Anonymous function ( https://js.arcgis.com/3.14/init.js:185:298 ) at k ( https://js.arcgis.com/3.14/init.js:189:425 ) at m ( https://js.arcgis.com/3.14/init.js:189:357 ) at resolve ( https://js.arcgis.com/3.14/init.js:191:441 )" } and SCRIPT1004: Expected ';' File: MapServer, Line: 1, Column: 10 {"status":"error","messages":["The ArcGIS Web Adaptor has been configured with SSL/HTTPS. Please enable SSL/HTTPS for your ArcGIS Server Site."]} We changed our rest services to be served out non-https (non-mixed, both http), so why this error?
... View more
10-28-2015
02:25 PM
|
0
|
3
|
23
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|