ERROR 000732 on executing TableToTable

1847
10
06-04-2018 05:58 AM
AndreasRuloffs1
New Contributor III

Hi there,

I am facing a strange Problem. In the following Script two Tables in an sql-Server Database should be exported.

The first one works, the second one not (I am sure it is spelled right).

import tempfile
import arcpyout

Location = tempfile.mkdtemp()
arcpy.TableToTable_conversion("../bamo.sde/bko.bkEingriffart",outLocation, "bkEingriffart.dbf")
arcpy.TableToTable_conversion("../bamo.sde/bko.bkMassnahmenbkMassnahmenZiele",outLocation, "bkMassnahmenbkMassnahmenZiele.dbf")‍‍‍‍‍‍‍‍‍‍

‍‍‍‍‍‍‍
I got the Error:

Traceback (most recent call last):  
File "C:\Users\xxx\.p2\pool\plugins\org.python.pydev_5.7.0.201704111357\pysrc\pydevd.py", line 1546, in <module>    
globals = debugger.run(setup['file'], None, None, is_module)  
File "C:\Users\xxx\.p2\pool\plugins\org.python.pydev_5.7.0.201704111357\pysrc\pydevd.py", line 982, 
in run    pydev_imports.execfile(file, globals, locals)  # execute the script  
File "C:\Repositories\Python\bkonline2-deploy\gp-services\bko\exportSHP.py", line 13, in <module>    
arcpy.TableToTable_conversion("../bamo.sde/bko.bkMassnahmenbkMassnahmenZiele",outLocation, "bkMassnahmenbkMassnahmenZiele.dbf")  
File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\conversion.py", line 2133, in TableToTable    
raise earcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Rows: Dataset ../bamo.sde/bko.bkMassnahmenbkMassnahmenZiele does not exist or is not supportedFailed to execute (TableToTable).‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


I use ArcGIS 10.3.1 for develpoing, but the error also occurs when using ArcGIS 10.5.1.

Later the Script shell run as a geoprocessing Task on an ArcGIS for server.

Has anybody an idea?

Best Regard,

Andreas

0 Kudos
10 Replies
AndreasRuloffs1
New Contributor III

Hi Aron,

unfortunately, it was not really solved, the Problem seemed to be that the table had not a simple key but a Composite one.

I solved it by adding a view to the database that joined both of the tables. Then I was able to use TableToTable on the view.

I hope this is an Option for you too.

Best regards,

Andreas