Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008

    Unanswered: db2 coalesce with concat columns replacing with null still shows special characters


    Can any one help me with this SQL.

    I am creating a view where in a column say colC definition is based on concat of two other columns that are separated by ';' ( v.colA||';'||v.colB ). The requirement is that if the value of the concat'd columns are null it should return null. In the above case it happens to return ';' even if the result is null. I tried using coalesce but still it's giving same error.

    coalesce(concat(concat(v.specialty_shops, ';'), v.face_category),'')
    coalesce(v.specialty_shops||';'||v.face_category, NULL)

    Can any one help,


  2. #2
    Join Date
    Jan 2003
    Provided Answers: 5
    Are you sure the columns are null? Concatting null to anything should return null. If they are empty strings (which are not null) then you will get the results you are getting.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts