title: How can I replacing empty ldtext column from longdescription table in maximo using sql
body: <p>Symptom,Cause,Resolution are not filled up, so it empty, 
  I want to replace the  fetched ldtext columns from long description table with some text.
  I want show null columns with some text in a report.</p>
  
  <p>Thank you</p>
  
  <p>To replace null values in column use <code>COALESCE()</code> function . For DB2 specific solution use <code>IFNULL()</code> function.</p>
  
  <pre><code>SELECT COALESCE(columnName,'Some Text')
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>SELECT IFNULL(columnName,'Some Text'
  
  SELECT b.ticketid,(SELECT COALESCE(CAST(SYMPTOM.LDTEXT AS VARCHAR(1000),'text') 
                     FROM MAXIMO.LONGDESCRIPTION SYMPTOM  
                     WHERE SYMPTOM.LDOWNERCOL = 'PROBLEMCODE' 
                           AND SYMPTOM.LDOWNERTABLE = 'TICKET' 
                           AND SYMPTOM.LDKEY = B.TICKETUID) AS "symptom" 
  FROM incident b
  </code></pre>
  
  <p>from the above query it doesn't work</p>
  
  <pre><code>SELECT b.ticketid, COALESCE(SELECT CAST(SYMPTOM.LDTEXT AS VARCHAR(1000)) 
                              FROM MAXIMO.LONGDESCRIPTION SYMPTOM  
                              WHERE SYMPTOM.LDOWNERCOL = 'PROBLEMCODE' 
                                    AND SYMPTOM.LDOWNERTABLE = 'TICKET' 
                                    AND SYMPTOM.LDKEY = B.TICKETUID), 'some text') AS "symptom"
  FROM incident b
  </code></pre>
  
  <p>It work as above</p>