laptop and a wrench

Error

Unable to edit versioned views using a Python script utilizing arcpy.ArcSDESQLExecute().

Última publicación: July 27, 2015 ArcSDE/Enterprise Geodatabase
Número de ID del error NIM088264
EnviadoJanuary 19, 2013
Última modificaciónApril 2, 2025
Relacionado conArcSDE/Enterprise Geodatabase
Versión encontrada10.1
EstadoKnown Limit

Información adicional

Correct syntax to include WITH RESULT SETS NONE and execute statements in batch (see workaround)

Solución alternativa

The error reported can be avoided by adding WITH RESULT SETS NONE:eGIS_Conn.execute("EXEC dbo.edit_version @name = 'dbo.Ch1', @edit_action=1 WITH RESULT SETS NONE ")However, because these versioned view stored procedures issue a hard commit to commit all the nested transactions, another error can be encountered unless the entire set of SQL is executed in batch:eg: eGIS_Conn = arcpy.ArcSDESQLExecute(eGIS)eGIS_Conn.execute("EXEC dbo.set_current_version @version_name = 'dbo.Ch1' ; EXEC dbo.edit_version @name = 'dbo.Ch1', @edit_action=1 WITH RESULT SETS NONE; EXEC dbo.edit_version @name = 'dbo.Ch1', @edit_action=2 WITH RESULT SETS NONE")The reason is that ArcSDE will by default always be in transaction.If the execute statements are not put in batch (like shown above) the transaction count will be different before and after execute the edit_version stored procedure and you will encounter the following error.Runtime errorTraceback (most recent call last):File "<string>", line 6, in <module>File "<a href="file:c:/arcgis/arcpy/arcpy/arcobjects/arcobjects.py" target="_blank">c:\arcgis\arcpy\arcpy\arcobjects\arcobjects.py</a>", line 27, in executereturn convertArcObjectToPythonObject(self._arc_object.Execute(*gp_fixargs(args)))AttributeError: ArcSDESQLExecute: StreamExecute ArcSDE Extended error 266 [Microsoft][SQL Server Native Client 11.0][SQL Server]Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.

Pasos para reproducir

ID del error: NIM088264

Software:

  • ArcSDE/Enterprise Geodatabase

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga