Skip to Content
avatar image
Former Member

Recursive Procedures in HANA

Hi Experts,

I have requirement in HANA in which i need to create a procedure which is recursively called to get the Bill Of Material information.

Can some one please guide me how can we write recursive procedures in HANA.

I heard that there are some issues with recursive procedures with which HANA cant create execution plan. Is that is true?? If yes, what would be the alternative for this??

Thanks in advance.

Best Regards,

Krishna.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 14, 2014 at 12:17 AM

    Yes HANA procedures must be non-recursive. Recursion breaks the way HANA processes parallelism.

    You need to write your procedure as a set function. Without knowing the details it's hard to provide more advice. Do avoid loops if at all possible. They kill performance.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Krishna,

      I am curious to know if you have found the solution and what approach did you to take to write the procedure in SQLScript. We also have a similar requirement in the project.

      Thanks,

      Aamod

  • avatar image
    Former Member
    Sep 12, 2014 at 10:10 AM

    Hi Krishna,

    as an alternative you can realize a loop (refactoring your recursive logic) within your script (either in a procedure or in a script based view).

    Best regards,

    Tamás

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Tamas,

      Thank you for your valuable information. So it is not possible to create a recursive procedure directly in HANA.

      I will try creating a procedure with loop.

      Best Regards,

      Krishna.