简体   繁体   中英

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) | (or) statement multiple times, can a list be input instead?

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

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM