I am trying to run the following query in SPUFI.
FROM DEVB.TAB2_DEPT TAB2,
WHERE TAB2.UNIT_ID = 'ABD'
AND TAB2.DEPT_ID = '01'
AND TAB1.PROD_TYP_DSC LIKE
FETCH FIRST 1 ROW ONLY
It is giving the SQLCODE=-132 which says that "ERROR: AN OPERAND OF LIKE IS NOT VALID".
I tried to use concat function also instead of using the operator '||'. Does anybody having any idea what is wrong in the query? Any help is highly appreciated. Thanks.
I have given CHAR after LIKE operator because TAB1.PROD_TYP_DSC column is having datatype CHAR. I could not get what you want to say.
I used CHAR('''%'||RTRIM(TAB2.DEPT_DSC)||'%''') in the select clause instead of using it in WHERE clause. There it is getting displayed as '%MEAT%' if the column TAB2.DEPT_DSC is having the value MEAT in the table TAB2. And, '%MEAT%' should be the value which can be used with LIKE operator. but i am getting SQLCODE=-132 when i use it in WHERE clause. .