SQL$HELP_OLD72.HLB  —  Built In Functions, CONCAT_WS
    The CONCAT_WS function returns the concatenated value expression
    using the first parameter as a separator which is applied after
    each of the other parameters.

    If the separator value expression resolves to NULL then the
    result of CONCAT_WS will be NULL. If any other parameter value
    expression resolves to NULL then it will be ignored. That is,
    that column value and any separator will not be included in the
    output.

    The function CONCAT_WS accepts all data types with the exception
    of LIST OF BYTE VARYING, LONG, and LONG RAW. Each non-character
    string value will be implicitly converted to VARCHAR with a size
    appropriate for the data type.

    The result of this function will have the type VARCHAR with a
    length long enough for the concatenated data and separators.

    If dialect ORACLE LEVEL1 or ORACLE LEVEL2 is used then zero
    length strings ('') will be considered as NULL and so be excluded
    from the output. If the resulting value is a zero length string
    then the result of CONCAT_WS will be NULL.

    Example: Using the CONCAT_WS function to simplify the formatting
    of table data in CSV (comma separated value) format.

    SQL> select '"' ||
    cont> CONCAT_WS ('", "', first_name, nvl(middle_initial,''), last_name)
    cont> || '"'
    cont> from employees
    cont> order by employee_id;

     "Alvin     ", "A", "Toliver       "
     "Terry     ", "D", "Smith         "
     "Rick      ", "", "Dietrich      "
     "Janet     ", "", "Kilpatrick    "
     . . .
     "Peter     ", "", "Blount        "
     "Johanna   ", "P", "MacDonald     "
     "James     ", "Q", "Herbener      "
    100 rows selected
    SQL>
Close Help