0 Replies Latest reply: Mar 30, 2012 4:35 PM by 927635 RSS

    Regular expression problem


      I'm trying to use the following regular expression in 9i:


      which PL/SQL translates to:


      However, when I try to run the owa_pattern.match function it raises the following error:

      create or replace function sql_match (exp varchar2, regexp varchar2) return number as
      if (owa_pattern.match(exp, regexp)) then
      return 1;
      return 0;
      end if;

      select sql_match('NOT IN (''a'')','^((NOT)\s)?(IN)\s*\(\s*\''\w+\''\s*(,\s*\''\w+\''\s*)*\)\s*$') from dual

      ORA-06502: PL/SQL: erro numérico ou de valor : character to number conversion error
      ORA-06512: na "SYS.OWA_PATTERN", linha 444
      ORA-06512: na "SYS.OWA_PATTERN", linha 579
      ORA-06512: na "SYS.OWA_PATTERN", linha 997
      ORA-06512: na "TSTRDWLN.SQL_MATCH", linha 3

      Any ideas on why this is happening?

      Thanks in advance.