I have a problem in using the Select_analysis or Select by attribute, what I need t do, is to extract all the residential uses from a land use feature class, and make a feature class for residential, but there are more than one value for residential uses like (''Residential and driving school'', ''mixed commercial Residential'', ''mixed residential with other uses'', 'residential') As I use the following script:
uses_FieldForLandUses= arcpy.GetParameterAsText(4) # field of land use
Values_of_Residential_uses_in_Land_use_field= arcpy.GetParameterAsText(5) # type: string (multi value)- all the values for residential
Output_Residential_uses_parcels= arcpy.GetParameterAsText(6) # type: feature class
#Variables for residential uses
valueList = [x.strip() for x in Values_of_Residential_uses_in_Land_use_field.split(";")]
FieldInfo = arcpy.ListFields(inputLandUseParcels_FeatureClass,uses_FieldForLandUses)[0]
fieldType = FieldInfo.type
if uses_FieldForLandUses == '#' or not uses_FieldForLandUses:
Field = "LAND_USE" # provide a default value if unspecified
# Process: Select
if fieldType == 'String':
where = "{} IN ('{}')".format(arcpy.AddFieldDelimiters(inputLandUseParcels_FeatureClass,uses_FieldForLandUses), "', '".join(valueList))
arcpy.Select_analysis(inputLandUseParcels_FeatureClass, Output_Residential_uses_parcels, where)
but when selecting more than one value for residential, I get the following error:
ExecuteError: ERROR 000358: Invalid expression land_use IN (''Residential and driving school'', ''mixed commercial Residential'', ''mixed residential with other uses'', 'residential')
Failed to execute (Select).
{}
button to prepend four spaces on each line.