Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4192

If a column is blank the TEXTAGG function excludes it from the output

XMLWordPrintable

    • Hide

      add NVL for every column as shown below.

      TEXTAGG(FOR NVL(Last_Name, ''),
      NVL(First_Name, ''),
      NVL(Middle_initial,''),
      NVL(Currency_Code, '')
      DELIMITER '|' QUOTE '"'
      )

      Show
      add NVL for every column as shown below. TEXTAGG(FOR NVL(Last_Name, ''), NVL(First_Name, ''), NVL(Middle_initial,''), NVL(Currency_Code, '') DELIMITER '|' QUOTE '"' )

      If a column value is blank, it is excluding it in the result, causing incorrect output.

      TEXTAGG(FOR Last_Name,
      First_Name,
      Middle_initial,
      Currency_Code
      DELIMITER '|' QUOTE '"'
      )

      In the above example, if middle name is blank, then it should still show one empty column with "|" delimiter as shown below.

      Steigner|Debbie||USD

      But it returns output as excluding middle name since it is blank.

      Steigner|Debbie|USD

              rhn-engineering-shawkins Steven Hawkins
              rhn-support-dsteigner Deborah Steigner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: