Hi,The following code add two arguments to the Python call. The first argument works fine but the second gives an invalid SQL error when using SELECT. The script I have attached shows the parcel string hard coded to a Parcels variable, this works OK. Can someone provide the correct string for strParcels? Note the \\ is meant to relate to a \ in the final SQLstrOwner = "Lett" strParcels = "PARCEL_SPI = '1\\TP8994'" retVal = Shell("cmd.exe /K S:\MID_Owners_Database_Workspace\OwnerProperty.py " & strOwner & " " & strParcels, 1)
strOwner = "Lett" strParcels = "PARCEL_SPI = '1\\TP8994'" retVal = Shell("cmd.exe /K S:\MID_Owners_Database_Workspace\OwnerProperty.py " & strOwner & " " & strParcels, 1)
strOwner = """Lett""" strParcels = """PARCEL_SPI = '1\TP8994'""" retVal = Shell("cmd.exe /K " & _ "C:\Python27\ArcGIS10.1\python.exe " &_ "S:\MID_Owners_Database_Workspace\OwnerProperty.py " &_ strOwner & " " & strParcels, _ 1)
C:\> cmd.exe /K C:\Python27\ArcGIS10.1\python.exe ^ S:\MID_Owners_Database_Workspace\OwnerProperty.py "Lett" "PARCEL_SPI = '1\TP8994'"
C:\> C:\Python27\ArcGIS10.1\python.exe ^ S:\MID_Owners_Database_Workspace\OwnerProperty.py "Lett" "PARCEL_SPI = '1\TP8994'"
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.