I am executing the following code below. When we execute this on our
TEST system (Redhat 4.0, DB2 V8.2 FP11) the rows are returned in order
of dollar_range_fr om. We just moved our Production system from V7.2
(Redhat 2.1) to a
RedHat 4.0 64-bit/Db2 V8.2 64-bit FP14 enviromnment and now the below
code returns the rows out of order from the temp table even though
they were inserted with an order by.
DECLARE GLOBAL TEMPORARY TABLE session.TEMPTAB LE ( dollar_range_fr om
DECIMAL(15,2), dollar_range_to DECIMAL(15,2) )
ON COMMIT PRESERVE ROWS NOT LOGGED ;
insert into session.TEMPTAB LE
SELECT from_amount as dollar_range_fr om, to_amount as
dollar_range_to FROM prodsys.dollar_ range_bands WHERE
dollar_range_ty pe = 'T' AND report_ids = 'REPORT3' AND coverage_type =
'99' OrDER BY by dollar_range_fr om;
select * from session.temptab le;
TEST system (Redhat 4.0, DB2 V8.2 FP11) the rows are returned in order
of dollar_range_fr om. We just moved our Production system from V7.2
(Redhat 2.1) to a
RedHat 4.0 64-bit/Db2 V8.2 64-bit FP14 enviromnment and now the below
code returns the rows out of order from the temp table even though
they were inserted with an order by.
DECLARE GLOBAL TEMPORARY TABLE session.TEMPTAB LE ( dollar_range_fr om
DECIMAL(15,2), dollar_range_to DECIMAL(15,2) )
ON COMMIT PRESERVE ROWS NOT LOGGED ;
insert into session.TEMPTAB LE
SELECT from_amount as dollar_range_fr om, to_amount as
dollar_range_to FROM prodsys.dollar_ range_bands WHERE
dollar_range_ty pe = 'T' AND report_ids = 'REPORT3' AND coverage_type =
'99' OrDER BY by dollar_range_fr om;
select * from session.temptab le;
Comment