I'm attempting what I thought was a pretty straight-forward SQL statement. I'm trying to use a REGEX expression to only grab records that have a name consisting of only 3 numbers.
However, I'm getting an error and I can't figure out why. Because it's DB2, there aren't nearly as many examples to draw from (as there would be with Postgres, for example), so I'm stuck.
Can anyone see what's wrong?
SELECT
ia.ID
,ia.DESCRIPTION
FROM INVENTORY.ACTIVITIES ia
WHERE
REGEXP_LIKE(ia.NAME, '[0-9]{3}')
Error:
[IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token ")" was found following "(ia.NAME,'[0-9]{3}')". Expected tokens may include: "<interval_qualifier>". SQLSTATE=42601.