0

We have defined a grammar and are storing expression strings in our database that follow this grammar. One possible term in our expressions is IIF(condition, then, else). I need to query our expressions table for all expressions that contain a '+' in the condition of an IIF.

What I am trying to do with this statement below is search for conditions with any number of non-comma characters followed by a '+' followed by any number of non-comma characters followed by a comma. Where am I going wrong?

select * from ... and value like '%IIF([^\,]*\+[^\,]*\,%';

1
  • 1
    Are you sure that the LIKE operator accepts regular expressions at all? Commented Mar 3, 2014 at 16:04

1 Answer 1

2

Using REGEXP_LIKE would work for this type of query. The REGEXP_LIKE function would be called in the where clause and the parameters for the function call would look something like this:

WHERE REGEXP_LIKE (column_xyz, '.*IFF\([^,]*\+[^,]*,')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.