Reputation: 334
I am trying to build a recursive Stored Procedure in DB2 PL SQL. But a little late in the game did I realize that it would throw an undefined reference error. So is recursion not possible in DB2 PL SQL?
Upvotes: 1
Views: 693
Reputation: 65496
From the IBM Devworks by Serge Rielau and Rick Swagerman
There are multiple ways in which DB2 supports recursion in SQL. One of which is recursion using the ANSI SQL recursive UNION ALL approach. The other approach is using the CONNECT BY clause.
You need to use Modules or dynamic SQL according to this blog.
Upvotes: 2