The SQL concept of ‘temporary tables’ allows for creation of powerful SQL. Understanding the different types of temporary tables will allow the end-user the option to create useful SQL that may be relatively simpler to understand and allows great flexibility.
· DECLARED GLOBAL TEMPORARY TABLES (DGTT)
· CREATED GLOBAL TEMPORARY TABLES (CGTT)
· common table expressions (CTE)
· other forms of inline SQL
The presentation will attempt to clearly drive home the difference between DGTT and CGTT. I will share the experience of how a simple DGTT was used in a new high-volume transaction and cost was relatively high. Switching to CGTT fantastically reduced cost!
The presentation will also touch the concepts of Common Table Expressions (CTE) and “derived tables”. CTE allows one to write ‘big’ SQL that are easy to understand. CTE are my favorite SQL concept to exploit and use for producing ad-hoc complex SQL reports!
Brian Laube works for Manulife Financial, known as John Hancock in the USA. Brian is a DB2 application DBA with over 20 years of experience supporting development and production. Brian is mostly a Db2 zOS DBA but he can bluff his way through some Db2 LUW and Db2 Connect. Brian is a leader in the Central Canada Db2 User Group (www.ccdb2.ca) and is currently chair of the IDUG content committee (https://www.idug.org/learn/content-ar.... Brian has presented at several IDUG NA conferences and twice at IDUG EMEA. He is also a juggler.