Selecting data I just inserted into a Table [email protected] (Simon Hutchinson)

​This piece of SQL was brought to my attention by a friend who works with Db2 for z/OS (mainframe). He said that at times he uses what I am going to explain to validate that the data he inserted into Table has the values he expected.
He refers to it as “Select final table”, which will be the name I am going to use for it. I did find this referred to in the IBM Documentation web site, there is a link to this page at the bottom of this post. The Db2 for z/OS version has more functionality than one for Db2 for i. This has me puzzled, why they are not the same?
With Db2 for i “Select final table” can only be used with a SQL Insert subselect. It returns the rows that were inserted into the table.
The Table, TESTTABLE, I will be using in these examples has two columns:
Read more » Read More 

Verified by MonsterInsights