PasitoTunTun
PasitoTunTun

Reputation: 13

REGEXP_LIKE Oracle function

I have a list of 100 words that I need to do a pattern match on 55 Million rows of data. Is there a way to create a list of words and pass the list through the REGEXP_LIKE function, instead of using the | (or) statement multiple times, can a list be input instead?

Search *
From table
Where REGEXP_LIKE(C1, 'wordlword2letc...', 'i');

Upvotes: 1

Views: 298

Answers (1)

Incognito
Incognito

Reputation: 3094

You cannot pass a list of words as pattern in REGEXP_LIKE.

pattern is the regular expression and usually is text literal and cannot be more than 512 bytes.

What you can possibly do is, store the words you're trying to search in separate table/column and then use LIKE condition in your query as you're just trying to search for the occurrence of the words and not expecting regular expression search support.

So, if there is a table/column (new_table.col) which stores your input items to search for, your query might look like (using UPPER function to ensure case insensitive search as you were trying) -

SELECT a.* FROM table a, new_table b WHERE UPPER(a.col1) LIKE UPPER(b.col);

Upvotes: 3

Related Questions