Hello all,
I'm puzzled why REGEXP_COUNT returns weird results, for example take this query:
Regular expression [A-Z] means it accepts a letter from A to Z. But 1 is no letter, and the result of this query is 2 which is wrong!
This happens if I try to use this SQL in a RPG program or via STRSQL interactive job.
However, in my emulator there is an option "Run SQL Scripts" which opens a SQL client application. When I execute the SQL in this client the result is 0 which is correct!
REGEXP_COUNT works like a charm!
When using this SQL client the job is 123456/QUSER/QZDASOINIT.
Why in job 123456/QUSER/QZDASOINIT it works perfectly but when I try to use in another job I get funny results? The CCSID is the same in both jobs -> 500.
Any help is very welcome. Regular expressions would solve a important problem for our business.
Thank you in advance
I'm puzzled why REGEXP_COUNT returns weird results, for example take this query:
PHP Code:
select regexp_count('1','[A-Z]')
from SYSIBM.SYSDUMMY1
Regular expression [A-Z] means it accepts a letter from A to Z. But 1 is no letter, and the result of this query is 2 which is wrong!
This happens if I try to use this SQL in a RPG program or via STRSQL interactive job.
However, in my emulator there is an option "Run SQL Scripts" which opens a SQL client application. When I execute the SQL in this client the result is 0 which is correct!
REGEXP_COUNT works like a charm!
When using this SQL client the job is 123456/QUSER/QZDASOINIT.
Why in job 123456/QUSER/QZDASOINIT it works perfectly but when I try to use in another job I get funny results? The CCSID is the same in both jobs -> 500.
Any help is very welcome. Regular expressions would solve a important problem for our business.
Thank you in advance
Comment