We are on OS7.2 and I have a simple SQL that looks like this:
I'd like to replace the like '%xx' clause with a regular expression:
However, this causes an error:
SQL0181
SQL State 22007.
Vendor Code -181
Message: Value in date, time or timestamp string not valid.
Note that yyyy-mm-dd is a real date (e.g. 2020-09-11).
field1 is a character field.
field2 is a timestamp.
Regular expressions are very foreign to me however I can't understand why changing the Like clause to a regexp_like is causing an issue with the Date(field2) condition? I'm sure it's something daft I'm doing...
Code:
Select * From lib/file Where field1 Like '%xx' And Date(field2) >= 'yyyy-mm-dd';
Code:
Select * From lib/file Where Regexp_Like(field1, '[x-y][x-y]$') And Date(field2) >= 'yyyy-mm-dd';
SQL0181
SQL State 22007.
Vendor Code -181
Message: Value in date, time or timestamp string not valid.
Note that yyyy-mm-dd is a real date (e.g. 2020-09-11).
field1 is a character field.
field2 is a timestamp.
Regular expressions are very foreign to me however I can't understand why changing the Like clause to a regexp_like is causing an issue with the Date(field2) condition? I'm sure it's something daft I'm doing...
Comment