laptop and a wrench

漏洞

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

上次发布: July 27, 2015 ArcSDE/Enterprise Geodatabase
漏洞 ID 编号 NIM088264
已提交January 19, 2013
上次修改时间April 2, 2025
适用范围ArcSDE/Enterprise Geodatabase
找到的版本10.1
状态Known Limit

附加信息

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

解决办法

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.

重现步骤

漏洞 ID: NIM088264

软件:

  • ArcSDE/Enterprise Geodatabase

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项