ArcGIS 10.1. When I try to export a table view with
CopyRows_management, I get an invalid sql error. However, the sql statement by all accounts work fine. When I perform a
GetCount_management, the results are correct. Is this a bug?
Code and error:
>>> sql = """"PARCEL_ID" IS NULL""" >>> outTab = r"C:\Users\e1b8\Desktop\E1B8\Snapping\workspace\workspace.gdb\table" >>> tab = r"C:\Users\e1b8\Desktop\E1B8\Snapping\Address_Tables_duplicate_addresses.gdb\_Geocode_Failures" >>> arcpy.MakeTableView_management (tab, "tabView", sql) <Result 'tabView'> >>> arcpy.GetCount_management (tab).getOutput (0) u'163083' >>> arcpy.GetCount_management ("tabView").getOutput (0) u'13688' >>> arcpy.CopyRows_management ("tabView", outTab) Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 13547, in CopyRows raise e ExecuteError: ERROR 999999: Error executing function. An invalid SQL statement was used. An invalid SQL statement was used. [table] An invalid SQL statement was used. [SELECT * FROM table] The table was not found. [table] Failed to execute (CopyRows). >>>