Select to view content in your preferred language

ArcSDESQLExecute problems

08-23-2011 08:30 AM
Occasional Contributor
I'm looking for anyone who has had experience with arcpy.ArcSDESQLExecute.

I am trying to use Python in ArcGIS 10.1 to return a selected set from an ArcSDE/SQL Server table and write it out to a new table in a file geodatabase. Right now I'm just doing some basic testing to see if I can get it to work correctly because at 9.3.1 there was a serious bug related to the handling of NULL values. That issue appears to be fixed, but now I'm having a different problem.

The new issue I'm having with ArcGIS 10 version is that the returned object (list of lists) causes a Visual C++ error when the object is deleted. Doesn't matter when I delete the list object or if I let  Python clean up after executing the script. It will throw that error and I have to kill the application. I've tried running from ArcCatalog and ArcMap as an ArcTool.

There seems to be some relationship with the number of records returned. If I only do a few hundred, the script will usually exit successfully. I've tested with several hundred thousand records in different tables and don't see the client running out of memory and I can iterate through the list without any problems and write everything to a new table.

I also tried pausing the script for a few seconds at different points, but haven't seen any difference in performance.

My test script is attached, any help would be greatly appreciated!

0 Kudos
0 Replies