Select to view content in your preferred language

Python Code Help Needed:Commerical Property Imports

1908
12
06-06-2014 02:00 PM
RaoulComaduran
Deactivated User
Hello all,

I am still relatively new to python and trying to troubleshoot these automated python codes as much as a I can but to no avail. I have the script that is supposed to run twice daily and import data from a webform and place it into a layer in our SDE master db. please let me know what errors you see in the line of code below. Thank you in advance.

Raoul
Tags (2)
0 Kudos
12 Replies
AshleyRiggs
Deactivated User
I have run this code and received this error log but not sure how to correct it. Thank you for any insight:

>>> Process started at 06-09-2014 08:55:54 AM.

Preparing in memory data........10%
Traceback (most recent call last):
  File "\\aubpm02\c$\scripts\PropertyListings\CommercialPropertyImport_V1.2.py", line 79, in <module>
    arcpy.TableToTable_conversion(web_forms_dbo_v_GISPropertyImport, in_memory, "brokers", "", "Property \"Property\" true true false 15 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\\dbo.v_GISPropertyImport,Property,-1,-1;ADDRESS \"ADDRESS\" true true false 81 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,ADDRESS,-1,-1;Site \"Site\" true true false 4 Long 0 10 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Site,-1,-1;Street \"Street\" true true false 50 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Street,-1,-1;PIN \"PIN\" true true false 10 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,PIN,-1,-1;Status \"Status\" true true false 50 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Status,-1,-1;Listing \"Listing\" true true false 15 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Listing,-1,-1;Email \"Email\" true true false 50 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Email,-1,-1;Phone \"Phone\" true true false 50 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Phone,-1,-1;Contact \"Contact\" true true false 50 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Contact,-1,-1;Firm \"Firm\" true true false 50 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Firm,-1,-1;Expires \"Expires\" true true false 36 Date 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Expires,-1,-1;Requested \"Requested\" true true false 36 Date 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Requested,-1,-1;Link \"Link\" true true false 300 Text 0 0 ,First,#,Database Connections\\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport,Link,-1,-1", "")
  File "C:\Program Files\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py", line 2042, in TableToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Rows: Dataset Database Connections\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport does not exist or is not supported
Failed to execute (TableToTable).

Process failed at 06-09-2014 08:55:54 AM.
Traceback (most recent call last):
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File "\\aubpm02\c$\scripts\PropertyListings\CommercialPropertyImport_V1.2.py", line 147, in <module>
    LogFile = file('C:\\scripts\\PropertyListings\\error.txt', 'w') #Creates a log file with todays date.
IOError: [Errno 2] No such file or directory: 'C:\\scripts\\PropertyListings\\error.txt'
>>>
0 Kudos
JamesCrandall
MVP Alum
I have run this code and received this error log but not sure how to correct it. Thank you for any insight:

Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport 




Just to start, I'd check your SDE Connections to make sure "Webforms@AUBPM01.sde" does in fact exist on the machine you are executing the script.  Also, look at the database itself to see if "web_forms.dbo.v_GISPropertyImport" database view does in fact exist.
0 Kudos
MichaelVolz
Esteemed Contributor
What version of ArcGIS are you using?

Is this a script that you inherited from someone else who ran it on a different machine?
0 Kudos
AshleyRiggs
Deactivated User
Just to start, I'd check your SDE Connections to make sure "Webforms@AUBPM01.sde" does in fact exist on the machine you are executing the script.  Also, look at the database itself to see if "web_forms.dbo.v_GISPropertyImport" database view does in fact exist.


I just checked that connection on the server we have named AUBPMO1 and that db does exist as well as that database table.

I figured that might have been that case, so I re-established that connection on our server in ArcCatalog and then reran the script and still this error was popping up.
0 Kudos
AshleyRiggs
Deactivated User
What version of ArcGIS are you using?

Is this a script that you inherited from someone else who ran it on a different machine?


We are using ArcGIS 10.2 and this was a script that ran successfully off the server aubmp01( after our migration to 10.2) from as recently at Feb.

Thoughts?
0 Kudos
MichaelVolz
Esteemed Contributor
I think you need the full path to the SDE connection file in your script.

If you are running on Windows 7 or Windows Server 2008, then the path would be something like:

c:\Users\"User Name"\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\ + Webforms@AUBPM01.sde\web_forms.dbo.v_GIS

I know that in my scripts when I migrated from v10.0 to v10.2 (I skipped v10.1), the python scripts now needed the full path to the SDE connection files.
0 Kudos
RaoulComaduran
Deactivated User
I think you need the full path to the SDE connection file in your script.

If you are running on Windows 7 or Windows Server 2008, then the path would be something like:

c:\Users\"User Name"\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\ + Webforms@AUBPM01.sde\web_forms.dbo.v_GIS

I know that in my scripts when I migrated from v10.0 to v10.2 (I skipped v10.1), the python scripts now needed the full path to the SDE connection files.


That helps immensely. I will try that out and see if I have any luck know. Thank you for the insight.
0 Kudos
RaoulComaduran
Deactivated User
That helps immensely. I will try that out and see if I have any luck know. Thank you for the insight.


I tried using the full SDE link but still, no go.

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Rows: Dataset \\aubpm02\c$\Users\administrator.COA\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Webforms@AUBPM01.sde\web_forms.dbo.v_GISPropertyImport does not exist or is not supported
Failed to execute (TableToTable).
0 Kudos
MichaelVolz
Esteemed Contributor
Raoul:

Can you try making 2 modifications to the architecture of this project?

1.)Export your SDE data to a file geodatabase
2.)Modify your data variables to hit the file geodatabase feature classes

Run the script and see if you get the same type of error

Did you export this from a model?  It looks like it because of all the duplicate GIS_USER_CommercalPropertyLi__ entries with different numbers but pointing to the same data source.  I would also advice cleaning up these variables to minimize their use.
0 Kudos