OK I've found solution.
For others with same problem:
when e.g. WS-VAR is PIC X(20) and we pass 'SANTA C%' (8 characters) - rest of the variable's buffer should be filled by '%'
Marcin Domaslawski
User Profile
Collapse
-
Problem with LIKE in cursor
Hi all,
DB2 on AS/390. I read from table using cursor:
DECLARE SAMPLCUR1 CURSOR
WITH ROWSET POSITIONING FOR
SELECT
COL1, COL2, COL3
FROM TABLENAME
WHERE
COL4 LIKE :WS-SOMEVAR
FOR FETCH ONLY
WITH UR
and from this I get e.g. 10 rows at once. Problem is, that LIKE in statement above doesn't work, when WS-SOMEVAR contain an SPACE e.g. WS-SOMEVAR =...
No activity results to display
Show More
Leave a comment: