|
POST
|
I have this issue as well on a SQL Express Database with a text field. did you find a solution or work around?
... View more
03-05-2018
01:24 PM
|
0
|
0
|
1922
|
|
BLOG
|
No, i run it in python within a edit session. The if check is working great for me and eliminated the crashing. Are you setting your edit session as edit = arcpy.da.Editor(arcpy.env.workspace) edit.startEditing(False, True) edit.startOperation() I had True, True at first and it wasn't working right. The False, True worked better on my versioned database. The one thing i had to do was export the schema i was wanting to update into a temp database then load the data i wanted to compare into it. so the fields i was comparing were exactly the same type, size, etc.
... View more
02-26-2018
10:50 AM
|
1
|
0
|
28705
|
|
IDEA
|
This seems like it should work but i don't get any results. Is there any other way to see if the replica is invalid? Would i look in the database for just sends or a specific statement? Thanks
... View more
02-12-2018
05:53 AM
|
1
|
1
|
3388
|
|
BLOG
|
Thank you so much. I didn't realize the field types would matter. that is probably the issue. I did run the code as it was and it didn't fail so i think the edits are still less than before. I will try the single field at a time. Thank you so much for your help on this. I refer to this blog a ton and really appreciate the work you put into it and also the quick response with help on this. Thanks again!!
... View more
12-26-2017
10:53 AM
|
0
|
0
|
28705
|
|
BLOG
|
Thanks the script will work but it still runs through each record and makes a change. I feel so close. i see the keyvalue (updated feature) is being compared in the valueDict (source feature). I feel it is around this section i'm stuck if list(valueDict[keyValue]) <> updateRow[1:22]: # A change has been made to the mailing address, owner names or both changeCnt += 1 Thank you again. Here is what i have. import arceditor import arcpy from time import strftime workspace ="E:\\arcgisserver\\Resources\\Connections\\GIS_SCRIPTINGVS.sde" serviceFC = arcpy.MakeFeatureLayer_management("E:\\arcgisserver\\Resources\\Connections\\GIS_SCRIPTINGVS.sde\\.DBO.ELECTRIC\\.DBO.ServicePoint", "test","LINE_SECTION = 'PRIUG6819'","","OBJECTID OBJECTID VISIBLE NONE;AncillaryRole AncillaryRole VISIBLE NONE;Enabled Enabled VISIBLE NONE;SubtypeCD SubtypeCD VISIBLE NONE;Account_Number Account_Number VISIBLE NONE;SERVICE_MAP_LOCATION SERVICE_MAP_LOCATION VISIBLE NONE;MeterNumber MeterNumber VISIBLE NONE;TRANSFORMER_ID TRANSFORMER_ID VISIBLE NONE;MAP_NO MAP_NO VISIBLE NONE;LINE_SECTION LINE_SECTION VISIBLE NONE;SUBSTATION SUBSTATION VISIBLE NONE;FEEDER_NUMBER FEEDER_NUMBER VISIBLE NONE;SERVICE_STATUS SERVICE_STATUS VISIBLE NONE;Service_Number Service_Number VISIBLE NONE;CC_Number CC_Number VISIBLE NONE;NAME NAME VISIBLE NONE;SERVICE_ADDRESS SERVICE_ADDRESS VISIBLE NONE;SERVICE_ADDRESS2 SERVICE_ADDRESS2 VISIBLE NONE;CITY CITY VISIBLE NONE;STATE STATE VISIBLE NONE;DESCRIPTION DESCRIPTION VISIBLE NONE;DateModified DateModified VISIBLE NONE;InstallationDate InstallationDate VISIBLE NONE;Comments Comments VISIBLE NONE;ServiceCurrentRating ServiceCurrentRating VISIBLE NONE;LoadManagement LoadManagement VISIBLE NONE;MISC_CHAR_1 MISC_CHAR_1 VISIBLE NONE;MISC_CHAR_2 MISC_CHAR_2 VISIBLE NONE;OutagePriority OutagePriority VISIBLE NONE;Zip Zip VISIBLE NONE;Detail Detail VISIBLE NONE;KeyAccount KeyAccount VISIBLE NONE;Longitude Longitude VISIBLE NONE;Latitude Latitude VISIBLE NONE;Township Township VISIBLE NONE;Section_ Section_ VISIBLE NONE;T_S T_S VISIBLE NONE;created_user created_user VISIBLE NONE;created_date created_date VISIBLE NONE;last_edited_user last_edited_user VISIBLE NONE;last_edited_date last_edited_date VISIBLE NONE;GlobalID GlobalID VISIBLE NONE;CustomerID CustomerID VISIBLE NONE;StationGuid StationGuid VISIBLE NONE;phaseCode phaseCode VISIBLE NONE;ADD3 ADD3 VISIBLE NONE;ACCTBASE ACCTBASE VISIBLE NONE;PrimaryPhone PrimaryPhone VISIBLE NONE;BusinessPhone BusinessPhone VISIBLE NONE;MobilePhone MobilePhone VISIBLE NONE;CustID CustID VISIBLE NONE;CoopNumb CoopNumb VISIBLE NONE;CISPhase CISPhase VISIBLE NONE;MEDALERT MEDALERT VISIBLE NONE;SHAPE SHAPE VISIBLE NONE") sourceFC="E:\\arcgisserver\\Resources\\ScriptingDB.gdb\\BISRV_BIPERCON" print "Start script: " + strftime("%Y-%m-%d %H:%M:%S") sourceFieldsList = ["BI_SRV_MAP_LOC","SRVADDR1","SRVADDR2","SRVST","SRVCITY","SRVZIP","BUSINESS","HOME","BICUST","MOBILE","BI_FORMAT_NAME","BI_FORMAT_ADDL_NAME","BI_KEY_CUST_CD","BI_ROUTE_CD","BI_OUT_PRI_CD","BI_MED_NEC_CD","BI_SRV_LOC","BI_AR_STAT","BI_ACCT", "BI_MTR_PHS", "BI_TRF_NBR", "BI_MTR_NBR"] edit = arcpy.da.Editor(workspace) edit.startEditing(False, True) edit.startOperation() valueDict = {r[0]:(r[1:])for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)} updateFC = "E:\\arcgisserver\\Resources\\Connections\\GIS_SCRIPTINGVS.sde\\GISDBO.ELECTRIC\\.DBO.ServicePoint" updateFieldsList = ["SERVICE_MAP_LOCATION","SERVICE_ADDRESS","SERVICE_ADDRESS2","STATE","CITY","Zip","BusinessPhone","PrimaryPhone","CustID","MobilePhone","NAME","MISC_CHAR_1","KeyAccount","MISC_CHAR_2","OutagePriority","MEDALERT","Service_Number","SERVICE_STATUS","Account_Number", "CISPhase","TRANSFORMER_ID","MeterNumber"] changeCnt = 0 with arcpy.da.UpdateCursor(updateFC, updateFieldsList) as updateRows: for updateRow in updateRows: keyValue = updateRow[0] # verify that the keyValue is in the Dictionary if keyValue in valueDict: # compare record in the dictionary to the existing update table record if list(valueDict[keyValue]) <> updateRow[1:22]: # A change has been made to the mailing address, owner names or both changeCnt += 1 for n in range (1,len(sourceFieldsList)): updateRow = valueDict[keyValue][n-1] updateRows.updateRow(updateRow) print changeCnt # Stop the edit session and save the changes ## edit.stopEditing(True) ## edit.startEditing(False, True) ## edit.startOperation() del valueDict #arcpy.DeleteManagement("test") edit.stopOperation() print "edits complete" # Stop the edit session and save the changes edit.stopEditing(True) arcpy.ClearWorkspaceCache_management() print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S") print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S")
... View more
12-26-2017
08:02 AM
|
0
|
0
|
28705
|
|
BLOG
|
Thank you so much this is exactly what i am looking for. i will give it a try. Happy holidays!
... View more
12-22-2017
03:45 PM
|
0
|
0
|
28705
|
|
BLOG
|
This works great however i have an issue with too many edits being made on a versioned database and it fails after a while. i have tried adding autocommit however it is not working in the loop. I am also not sure i wrote that correct. import arceditor import arcpy from time import strftime arcpy.env.workspace ="E:\\arcgisserver\\Resources\\Connections\\GIS_SCRIPTINGVS.sde" sourceFC="E:\\arcgisserver\\Resources\\ScriptingDB.gdb\\BISRV_BIPERCON" print "Start script: " + strftime("%Y-%m-%d %H:%M:%S") sourceFieldsList = ["BI_SRV_MAP_LOC","SRVADDR1","SRVADDR2","SRVST","SRVCITY","SRVZIP","BUSINESS","HOME","BICUST","MOBILE","BI_FORMAT_NAME","BI_FORMAT_ADDL_NAME","BI_KEY_CUST_CD","BI_ROUTE_CD","BI_OUT_PRI_CD","BI_MED_NEC_CD","BI_SRV_LOC","BI_AR_STAT","BI_ACCT", "BI_MTR_PHS", "BI_TRF_NBR", "BI_MTR_NBR"] edit = arcpy.da.Editor(arcpy.env.workspace) edit.startEditing(True, True) edit.startOperation() # Use list comprehension to build a dictionary from a da SearchCursor valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)} updateFC = "E:\\arcgisserver\\Resources\\Connections\\GIS_SCRIPTINGVS.sde\\GIS.DBO.ELECTRIC\\GIS.DBO.ServicePoint" updateFieldsList = ["SERVICE_MAP_LOCATION","SERVICE_ADDRESS","SERVICE_ADDRESS2","STATE","CITY","Zip","BusinessPhone","PrimaryPhone","CustID","MobilePhone","NAME","MISC_CHAR_1","KeyAccount","MISC_CHAR_2","OutagePriority","MEDALERT","Service_Number","SERVICE_STATUS","Account_Number", "CISPhase","TRANSFORMER_ID","MeterNumber"] arcpy.env.autoCommit = "" with arcpy.da.UpdateCursor(updateFC, updateFieldsList) as updateRows: for updateRow in updateRows: # store the Join value of the row being updated in a keyValue variable keyValue = updateRow[0] # verify that the keyValue is in the Dictionary print keyValue if keyValue in valueDict: # transfer the values stored under the keyValue from the dictionary to the updated fields. for n in range (1,len(sourceFieldsList)): updateRow = valueDict[keyValue][n-1] updateRows.updateRow(updateRow) del valueDict arcpy.DeleteManagement("test") edit.stopOperation() print "edits complete" # Stop the edit session and save the changes edit.stopEditing(True) print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S") print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S") Any guidance would be greatly appreciated thanks!
... View more
12-22-2017
06:50 AM
|
0
|
0
|
28705
|
|
POST
|
The issue with basemap is probably because of credentials. you will want to add a basemap specifically for off-line use (you can search this on arcgis online) to your Basemaps Gallery Store AGOL Credential.
... View more
09-05-2017
07:10 AM
|
0
|
0
|
2197
|
|
POST
|
Yes, We have 6 concurrent standard licenses. It shows only 3 pro on authorizations. i know 3 have been set up for our license manger. i was thinking i should see 3 on AGOL yet but there are not any shown. I don't even see a chart that says pro authorization in AGOL.
... View more
08-28-2017
05:25 AM
|
0
|
1
|
2371
|
|
POST
|
Are you allowed to share maps and apps to everyone from your Portal, restricting the log in on the ArcGIS Server instead of Portal Login? If not, are you able to do this using Web App Developer? Or inserting the viewing map into a website?
... View more
08-21-2017
11:48 AM
|
0
|
1
|
2078
|
|
POST
|
i have also found that i had this issue specifically on features with joins. i had to remove the join.
... View more
07-13-2017
08:26 AM
|
0
|
0
|
1344
|
|
IDEA
|
i have the same issue. i have a script that is set to list versions, then reconcile and delete. But all versions say to have children. i have a hard time telling if the version is still on the device and being used or if it was downloaded and removed without a sync.
... View more
07-13-2017
08:20 AM
|
2
|
1
|
3388
|
|
POST
|
Hi , Do you still have a code for this? this is exactly what i'm trying to do. Thank you in advance!!
... View more
04-12-2017
09:45 AM
|
0
|
7
|
2656
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 12-05-2022 07:02 AM | |
| 2 | 03-30-2021 05:40 AM | |
| 1 | 05-10-2019 01:40 PM | |
| 1 | 08-04-2020 06:00 AM | |
| 1 | 04-22-2015 06:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-05-2025
09:14 AM
|