CasaSpider

How to replace non-string parameters in arcgis function?

Discussion created by CasaSpider on Mar 18, 2011
Latest reply on Mar 21, 2011 by CasaSpider
Hello,
Our developers have exported a model built with ArcCatalog to a Python script.
This script has to run against various databases, so I would like to make the database name in the connection string variable. However, the connection is not a string. See the bold part below as an example. Now I have to repeat the same code in an if-statement every time. Does somebody know how I can call gp.FeatureClassToFeatureClass_conversion with variable database connections?

Thanx in advance!
Regards,
Peter Nijhuis,
Brabant Water,
The Netherlands.

if db == 'AGIS01':
  gp.FeatureClassToFeatureClass_conversion(FCL_W_SERVICE_Layer1__2_, Algemeen_temp_gdb, "gevoelig", "", "OBJ_ID 'UT Object ID' true true false 22 Text 0 0 ,First,#,Database Connections\\arcfmut@agis01.sde\\ARCFMUT.FDS_WATER\\ARCFMUT.FCL_W_SERVICE,ARCFMUT.FCL_W_SERVICE.OBJ_ID,-1,-1;ANGLE 'Angle' true true false 8 Double 8 38 ,First,#,Database Connections\\arcfmut@agis01.sde\\ARCFMUT.FDS_WATER\\ARCFMUT.FCL_W_SERVICE,ARCFMUT.FCL_W_SERVICE.ANGLE,-1,-1;LOCATIENUMMER 'LOCATIENUMMER' true true false 50 Text 0 0 ,First,#,Database Connections\\arcfmut@agis01.sde\\ARCFMUT.FDS_WATER\\ARCFMUT.FCL_W_SERVICE,ARCFMUT.UT_V_OCL_BW_GEVOELIG.ASSET_NO,-1,-1;RISICO_KLASSE 'RISICO_KLASSE' true true false 4 Long 0 10 ,First,#,Database Connections\\arcfmut@agis01.sde\\ARCFMUT.FDS_WATER\\ARCFMUT.FCL_W_SERVICE,ARCFMUT.UT_V_OCL_BW_GEVOELIG.RISICO_KLASSE,-1,-1;GEVOELIG 'GEVOELIG' true true false 50 Text 0 0 ,First,#,Database Connections\\arcfmut@agis01.sde\\ARCFMUT.FDS_WATER\\ARCFMUT.FCL_W_SERVICE,ARCFMUT.UT_V_OCL_BW_GEVOELIG.GEVOELIG,-1,-1;AACCOUNT 'AACCOUNT' true true false 50 Text 0 0 ,First,#,Database Connections\\arcfmut@agis01.sde\\ARCFMUT.FDS_WATER\\ARCFMUT.FCL_W_SERVICE,ARCFMUT.UT_V_OCL_BW_GEVOELIG.A_ACCOUNT,-1,-1", "")

Outcomes