Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

H2 not recognising regexp_like

I have a query written to run on an Oracle database which uses the function REGEXP_LIKE to filter some rows from the query. The specific function call is

regexp_like(col1, '[^[:alpha:]]')

The problem is when I run the query on H2 I get the following error:

org.h2.jdbc.JdbcSQLException: Function "REGEXP_LIKE" not found

If I run the query directly on the Oracle database using the SQLDeveloper tool it returns as expected.

Any ideas what could be causing this?

like image 400
Stefan101 Avatar asked Dec 01 '22 16:12

Stefan101


1 Answers

See the excellent documentation.

col REGEXP '[^[:alpha:]]'

In general SQL variants either use a function or named operator.

Whether the above specific regex works I do not know. One should be able to rely on java regular expressions.

like image 83
Joop Eggen Avatar answered Dec 10 '22 04:12

Joop Eggen