oamram

Variable within sql

Discussion created by oamram on Jun 5, 2011
Latest reply on Jun 8, 2011 by l3ll0
Hi All,
Before i give up i thought i will give it one more try.
i am trying to build a script that select data from a shapefile using the gp.Select_analysis.
In the selection statement i would like the field to be a variable but for some reason
i can't make it work.
i created a statement string where i try to select all value smaller the 3, as follow:
selection = "[" + fld + "] > " + str(3)
fld is a variable holding column name.

i inserted the statement string into the the gp.Select_analysis as follow:
gp.Select_analysis(fc, outFeatureClass, selection)

any help will be much appreciated, Omer.

Outcomes