错误信息:
---- error report ----
SQLCODE = -305
SQL0305N The NULL value cannot be assigned to a host variable because no
indicator variable is specified. SQLSTATE=22002
---- error report ----
--------------------------------------------------------------------------------------------------------------------------------
消息参考:
--------------------------------------------------------------------------------------------------------------------------------
解决方式:
原SQL语句:
SELECT A.CUST_NO, D.CUST_NAME
FROM TABLE1 A
LEFT JOIN TABLE2 D ON A.CUST_NO = D.CUST_NO
FOR FETCH ONLY
WITH UR;
修改为:
SELECT A.CUST_NO, VALUE(D.CUST_NAME,'') AS CUST_NAME
FROM TABLE1 A
LEFT JOIN TABLE2 D ON A.CUST_NO = D.CUST_NO
FOR FETCH ONLY
WITH UR;