laptop and a wrench

Erro

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

Última Publicação: July 27, 2015 ArcSDE/Enterprise Geodatabase
Número de ID do Erro NIM088264
EnviadoJanuary 19, 2013
Última ModificaçãoApril 2, 2025
Aplica-se àArcSDE/Enterprise Geodatabase
Versão encontrada10.1
StatusKnown Limit

Informações Adicionais

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

Solução Provisória

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.

Etapas para Reproduzir

ID do Erro: NIM088264

Software:

  • ArcSDE/Enterprise Geodatabase

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download