What are displayed in the
tableName are polygon features in a geodatabase. I would like for each row in a loop to take each row
TableName and apply the sql query from the
sqlstring field and make the feature according to that query that corresponds.
qname TheTableName SqlString 0 shp_q1 AST_A SELECT ... 1 shp_q2 AST_B SELECT ... 2 shp_q3 AST_PX SELECT ...
I want to make a new feature polygon according to what the query describes, named as the
qname column is named in that row.
Example: Take the
AST_A feature polygon, apply the query that it has in the
SqlString column and make a new feature polygon based on that query called
Here I access the columns that are needed:
datasetList = arcpy.ListTables("*") for dataset in datasetList: with arcpy.da.SearchCursor(dataset, ["TheTableName","SqlString"]) as cur: for row in cur: query = row #to access the query part of the row arcpy.SelectLayerByAttribute_management(row, "NEW_SELECTION", query)
row is the '
TheTableName' column and
row is the
How should I change the
SelectLayerByAttribute_management function parameters to achieve that?