A fix is available
APAR status
Closed as program error.
Error description
This issue is about incorrout of query with key word "except" when it runs as a subquery: eg: SELECT COUNT(*) FROM ( (SELECT * FROM T1) EXCEPT ALL (SELECT * FROM T2 WHERE ...) ) AS TEMP ; it runs as a subquery the count is higher. (SELECT * FROM T1) EXCEPT ALL (SELECT * FROM T2 WHERE...) ; returns expected results.
Local fix
N/A
Problem summary
**************************************************************** * USERS AFFECTED: DB2 for z/OS users with a query which * * contains UNION, EXCEPT, EXCEPT ALL or ORDER * * BY and whose top query block has exactly * * one table. * **************************************************************** * PROBLEM DESCRIPTION: A query may give incorrect output when * * the query satisfies the conditions * * below: * * * * 1.Top query block has exactly one * * table. * * 2.The query contains UNION, EXCEPT, * * EXCEPT ALL or ORDER BY. * **************************************************************** * RECOMMENDATION: * **************************************************************** A query may give incorrect output when the query contains UNION, EXCEPT, EXCEPT ALL or ORDER BY and its top query block has exactly one table. For example, SELECT * FROM (SELECT C1 FROM T1 UNION SELECT C1 FROM T2) AS T3
Problem conclusion
The problems mentioned above are fixed so that DB2 will return correct results in that situation. ADDITIONAL KEYWORDS: SQLUNION SQLEXCEPT SQLEXCEPTALL SQLORDERBY SQLINCORR INCORROUT SQLINCORROUT DB2INCORR/K
Temporary fix
********* * HIPER * *********
Comments
APAR Information
APAR number
PM78070
Reported component name
DB2 OS/390 & Z/
Reported component ID
5740XYR00
Reported release
910
Status
CLOSED PER
PE
NoPE
HIPER
YesHIPER
Special Attention
NoSpecatt
Submitted date
2012-11-29
Closed date
2013-01-21
Last modified date
2013-09-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
UK91069 UK91070
Modules/Macros
DSNXOPRP
Fix information
Fixed component name
DB2 OS/390 & Z/
Fixed component ID
5740XYR00
Applicable component levels
Fix is available
Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.1","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
26 September 2013