How can we help you today? How can we help you today?

Formatting issue with COALESCE

If I have a COALESCE with a lot of columns in it, it is kept in one row. Even, if the row is longer than the defined wrapping length ("Wrapping lines longer than 120 characters").
Would it be possible to also do a wrapping for the COALESCE()?

Thanks,
ThoschVX
0

Comments

3 comments

  • krzysztofkroczak
    Hi @ThoschVX,

    Thanks for reporting this. Can you please provide us with a quick example of a COALESCE statement, and how you would like to format it?

    Best regards,
    Krzysztof
    krzysztofkroczak
    0
  • ThoschVX
    Hi @krzysztofkroczak I would like to have it like this:
    COALESCE(
             ns.com_all_A0
            , ns.com_all_A1
            , ns.com_all_A2
            , ns.com_all_A3
            , ns.com_all_A4
            , ns.com_all_A5
            , ns.com_lastyear_A0
            , ns.com_lastyear_A1
            , ns.com_lastyear_A2
            , ns.com_lastyear_A3
            , ns.com_lastyear_A4
            , ns.com_lastyear_A5
            , ns.com_lastmonth_A0
            , ns.com_lastmonth_A1
            , ns.com_lastmonth_A2
            , ns.com_lastmonth_A3
            , ns.com_lastmonth_A4
            , ns.com_lastmonth_A5
            , ns.com_lastweek_A0
            , ns.com_lastweek_A1
            , ns.com_lastweek_A2
            , ns.com_lastweek_A3
            , ns.com_lastweek_A4
            , ns.com_lastweek_A5
            , ns.com_lastday_A0
            , ns.com_lastday_A1
            , ns.com_lastday_A2
            , ns.com_lastday_A3
            , ns.com_lastday_A4
            , ns.com_lastday_A5
    
    currently I get it like this after formating:
    COALESCE(ns.com_all_A0, ns.com_all_A1, ns.com_all_A2, ns.com_all_A3, ns.com_all_A4, ns.com_all_A5, ns.com_lastyear_A0, ns.com_lastyear_A1, ns.com_lastyear_A2, ns.com_lastyear_A3, ns.com_lastyear_A4, ns.com_lastyear_A5, ns.com_lastmonth_A0, ns.com_lastmonth_A1, ns.com_lastmonth_A2, ns.com_lastmonth_A3, ns.com_lastmonth_A4, ns.com_lastmonth_A5, ns.com_lastweek_A0, ns.com_lastweek_A1, ns.com_lastweek_A2, ns.com_lastweek_A3, ns.com_lastweek_A4, ns.com_lastweek_A5, ns.com_lastday_A0, ns.com_lastday_A1, ns.com_lastday_A2, ns.com_lastday_A3, ns.com_lastday_A4, ns.com_lastday_A5)
    

    Thanks,



    ThoschVX
    0
  • Michael Clark
    Hi @ThoschVX,

    Thanks for sending us your SQL example. We think the `COALESCE` statement should obey the same rules as functions but isn't currently. I have logged a bug under reference SP-6598 to investigate further. We will get back to you if we find a fix.

    Thanks,
    Michael
    Michael Clark
    0

Add comment

Please sign in to leave a comment.