I have created a script tool that allows users to select a single value from a pick list, which gets inserted into a query expression.
The pertinent part of my code is pretty simple:
Input = arcpy.GetParameterAsText(0)
arcpy.MakeQueryTable_management(inTable, "TabTemp", "", "", "", "FieldName = " + str(Input))
So if a user selects as input "Item1", then the resulting SQL expression is FieldName = Item1.
I am hoping to make the input a multi-value pick list, so that a user could potentially select one, or multiple values as Input. For example, if the user selects Item1, Item2 and Item3, then the SQL expression should look like:
FieldName = Item1 OR FieldName = Item2 OR Field Name = Item 3
I'm not quite sure how to get started with the python code to do this. Can anybody offer suggestions for creating the necessary code to compile the SQL expression from an unknown number of values obtained from a multi-value pick list?