As there's a limit of 512 bytes on the input of a regular expression pattern, I was wondering if there was any clever way around this?
Take the following example:
WITH t1
AS (SELECT 'this is phrase 1 this is phrase 2 this is phrase 3 ' phrase
FROM DUAL
UNION
SELECT 'this is phrase 2 this is phrase 1 this is phrase 3 ' phrase
FROM DUAL)
SELECT *
FROM t1
WHERE REGEXP_LIKE(phrase, 'this is phrase 1 this is phrase 2 this is phrase 3 ');
This is fairly self-explanatory; we get the correct row returned. But suppose the REGEXP_LIKE pattern to be used was large, and we split it up into 3 (or more) sections, at appropriate points. It can't simply be used with AND as in this example:
WITH t1
AS (SELECT 'this is phrase 1 this is phrase 2 this is phrase 3 ' phrase
FROM DUAL
UNION
SELECT 'this is phrase 2 this is phrase 1 this is phrase 3 ' phrase
FROM DUAL)
SELECT *
FROM t1
WHERE REGEXP_LIKE(phrase, 'this is phrase 1 ')
AND REGEXP_LIKE(phrase, 'this is phrase 2 ')
AND REGEXP_LIKE(phrase, 'this is phrase 3 ');
because then it doesn't know that the 3 sections of the pattern need to be in order, and hence all rows are returned.
Is there any way around this? e.g. getting the end position of the first phrase to use as the start point of the second phrase, hierarchies, etc.?
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Thanks.