I need to get features in a File GeoDatabase feature class whose "fieldName" (string field) value matches the value of "strValue" (string variable). While I know there are features satisfying this condition, Make Feature Layer seems to return an empty layer (the "Describe" object of it has an empty "FIDSet" list). On the other hand search cursor with the same SQL expression successfully returns those features. I'm scratching my head what I am missing.
This is the where clause:
wc = arcpy.AddFieldDelimiters(FGDB_FC, fieldName) + ' = ' + '\'' + strValue + '\''
This worked as expected:
rows = arcpy.SearchCursor(FGDB_FC, wc)
But this returned a seemingly empty feature layer (dd.FID has no element):
arcpy.MakeFeatureLayer_management(FGDB_FC, "fl", wc) dd = arcpy.Describe("fl") print dd.FIDSet.split(';')