Power of Recursive SQL
- Details
- Category: DB2
- Published: Thursday, 28 April 2016 23:08
- Written by Super User
- Hits: 1520
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in DB2 (from version 8 in both LUW and z/OS).
Why? Well, with recursive sql queries you can achieve things you would not have imagined being possible with SQL and all with just one sql-statement.
You can solve many types of business problems and even reduce some complex application logic down to a simple sql-call to the database.
What I like most of in using recursive sql query is ability to produce large amount of test-data in amount of seconds or minutes depending on complexity of the data and how many hundreds, thousands or millions of records that I want.
It has been proven that recursive queries outperforms other queries that take days to execute on huge amount of data by running in several minutes.
So how do you do it ?