def generateSQLFilter(sql_filter, es_type, category):
    """
    Generates the SQLite query to populate the Exposure Scenario tab.
    (e.g. "Category=? AND AppEquip IN (?, ?, ?, ?)") resulting in:
    SELECT DISTINCT Activity, AppType, AppEquip, Formulation FROM OccHandlerNC WHERE Category=? AND AppEquip IN (?, ?, ?, ?)

    :param sql_filter:
    :param es_type: string
    :param category: string
    :return: (SQLite query string, list of insertion values)
    """
    query_string = "Category = ? AND ("
    insertion_list = [category]

    i = 0
    while i < len(sql_filter):
        insertion_list.append(sql_filter[i])  # append values to be inserted into SQL statement (? substitution)
        if (i + 1) != 1:  # NOT first loop
            query_string += " OR "
        query_string += es_type + " = ?"
        i += 1

    query_string += ")"
    #
    #

    return query_string, insertion_list