0

I need to count the number of rows returned by REGEXP_LIKE() in oracle. how do I do that? I have tried the following query in a function:

RETURN COUNT(REGEXP_LIKE(SIN, '^(-|\\+){0,1}([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$'));
Gary_W
  • 9,933
  • 1
  • 22
  • 40

2 Answers2

0

Use regexp_count(https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions135.htm) instead of REGEXP_LIKE

Evgeniy K.
  • 1,137
  • 7
  • 11
0
SELECT COUNT(*) INTO sin_count FROM your_tbl WHERE REGEXP_LIKE(
    SIN, '^(-|\+){0,1}([0-9]+\.[0-9]|[0-9]\.[0-9]+|[0-9]+)$');
nilsman
  • 346
  • 1
  • 9