Skip to Content
avatar image
Former Member

Recursive SQL in SAP Hana

Hi,

it is possible execute a recursive SQL command? CTE or something else?

I want to calculate multiple columns, each based on the previous column...

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Dec 01, 2016 at 04:13 PM

    Hi,

    SAP HANA supports CTE but not recursive SQL (no DECODE too).

    The only way to do this is via SQL Script table variables (if restricted/defined in levels) procedural (Looping if indefinite levels or complex nesting rendering difficult maintenance in the future) or via separate Wrapper & Executor procedures.

    Refer https://archive.sap.com/discussions/thread/3384059 for more information.

    Regards,

    Kapil

    Add comment
    10|10000 characters needed characters exceeded