Using LIKE %...% in Drupal 7, Views 3 I'm trying to change the Views SQL operator from = 'String' to LIKE 'String%'.

I thought the best way to do this was through function hook_views_pre_execute(&amp;$view) at the bottom of views.module. I tried that, but any way I edited the query it would throw an error.

For example, I tried str_replace:

function views_views_pre_execute(&amp;$view) {
    if ($view-&gt;name == "schools")
    {
        $view-&gt;build_info['query'] = str_replace("location.city = :db_condition_placeholder_3","location.city LIKE '".$view-&gt;build_info['substititions']['%2']."'",$view-&gt;build_info['query']);
    }
}


I expected this code to edit the query so it would search location.city LIKE 'Calgary%', but instead I got Fatal error: Call to a member function addMetaData() on a non-object in [...]/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1306.

I read the documentation, but it looks like when they refer to Wildcards like %1 and %2, they're referring to arguments passed as contextual filters, as opposed to an SQL LIKE %...% wildcard.

What am I doing wrong?
I wound up using the Computed Field module to create a custom SQL query.