Hi there,
By default, a column will be inserted a '-' by the DB2. Say, my table (TEST) data as below (both columns are CHAR):
FNAME LNAME
----- -----
- lname1
where '-' automatically inserted by DB2 when I executed the insert statement: INSERT INTO TEST (LNAME) VALUES ('lname1').
When I tried to do this: SELECT CASE WHEN FNAME='' THEN 'fname1' WHEN FNAME='-' THEN 'fname1' ELSE FNAME END FROM TEST, the result is '-'. What can I do in order to get the correct result and not '-'?
By default, a column will be inserted a '-' by the DB2. Say, my table (TEST) data as below (both columns are CHAR):
FNAME LNAME
----- -----
- lname1
where '-' automatically inserted by DB2 when I executed the insert statement: INSERT INTO TEST (LNAME) VALUES ('lname1').
When I tried to do this: SELECT CASE WHEN FNAME='' THEN 'fname1' WHEN FNAME='-' THEN 'fname1' ELSE FNAME END FROM TEST, the result is '-'. What can I do in order to get the correct result and not '-'?