On 1/29/16, Cecil Westerhof <cldwesterhof at gmail.com> wrote:
> In H2 I can find records containing non-ascii characters with:
>     SELECT *
>     FROM <TABLE>
>     WHERE STRINGENCODE(<COLUMN>) LIKE '%\\u%'
>
> Is something like this also possible with SQLite?

Perhaps something like this:

  SELECT * FROM <table> WHERE <column> GLOB ('*[^'||char(1,45,127)||']*');

Note, however, that the "*[" combination in a GLOB pattern in SQLite
is inefficient. So the above might be slow for a large amount of text.
Perhaps a better approach would be to create an application-defined
function to do the search.

  SELECT * FROM <table> WHERE contains_non_ascii(<column>);


-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to