This portal is to open public enhancement requests against products and services offered by the IBM Data & AI organization. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
Shape the future of IBM!
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Search existing ideas
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updateson them if they matter to you. If you can't find what you are looking for,
Post your ideas
Post ideas and requests to enhance a product or service. Take a look at ideas others have posted and upvote them if they matter to you,
Post an idea
Upvote ideas that matter most to you
Get feedback from the IBM team to refine your idea
Specific links you will want to bookmark for future use
DGTT - declare and use in one SQL statement (basically, this RFE is extension to syntax and functionality of DGTT)
Sometimes we use DGTT to hold complex result sets with many columns.
We must DECLARE the DGTT first… and then second, INSERT into the DGTT
The DECLARE requires us to think about each column name and type if we list them explicitly. OR. We can DECLARE the DGTT “as (fullselect) with no data” where the “fullselct” is a copy of the SQL SELECT that will be later used with the INSERT into the DGTT.
The advantage of using the “as (fullselect) with no data” is that we don't need to think too much about the column names and types and sizes. They all come from the provided SELECT.
BUT it is subjectively “ugly” to have same “select” repeated twice in the SQL script. First, in the DGTT and second in the INSERT into DGTT.
Why can't DB2 allow us to dynamically DECLARE the DGTT and INSERT into this DGTT in one SQL statement. It seems logical! And the DB2 syntax for DECLARE GLOBAL TEMPORARY TABLE suggests this might be possible because it obliges us to add ‘with no data' when using FULLSELECT to declare the table.
> The existing documentation is very clear that when ‘when no data' is used that the SELECT is not executed.
How about syntax option alternative/opposite to ‘with no data' to allow us to insert immediately? (you can pick the syntax) It seems like IBM was thinking about this already! Why else have ‘with no data' unless IBM was thinking of the ‘opposite' functionality for the future!!
ORACLE and SQLSERVER implement “declared temporary tables” differently than DB2… but the concepts exist. And in those database technologies, it is possible to declare the temporary table and insert into it in the same time! Just one SQL statement! Basically, I would like to do the same with DB2!
Do not place IBM confidential, company confidential, or personal information into any field.