IBM Support

PM31237: SQL DISTINCT with parenthesis returns wrong value

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Environment: z/os
    
    Product name: IBM? Rational? Business Developer
    Program Version    :  7.5.1.6
    Description.
    Using a DISTINCT SQL option with parenthesis returns the wrong
    value when implementing the applicable data access with the EGL
    debugger and generated code at runtime Java and COBOL.
    
    Example scenario:
    DISTINCT with parenthesis:
      try
            get FFDI_DB_LAN_UDAMORT_GODK
                            with #sql{select distinct (FORFDT)
            from
                    T.LAN_UDAMORT_GODK
    
            WHERE
                    LANID  =  100256
                    };
    Will incorrectly return the result as a zero , null value
    irrespective of what should be output.
    The same DISTINCT without parenthesis:
      try
            get FFDI_DB_LAN_UDAMORT_GODK
                            with #sql{
            select distinct FORFDT
            from
                    T.LAN_UDAMORT_GODK
            WHERE
                    LANID  =  100256
                    };
    returns the correct result.
    
    NB: Identified by development as a defect in the preprocessor
    via escalation RATLC01519477 ie
    the problem is that on the ir.getIntoExpressions() call, the
    preprocessor is not returning anything in the array of
    expressions (size = 0), when the ( ) are used after the distinct
    keyword. When the ( ) are not used, then the
    ir.getIntoExpressions() call is correctly returning the array of
    1 expressions.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The code was not finding the corresponding column (field)
    because it was failing to strip off the quotes.
    

Problem conclusion

  • I have modified the code to be able to strip off quotes as
    well as stripping off distinct(...) and all(...)
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM31237

  • Reported component name

    RBD EGL FOR COB

  • Reported component ID

    5724S5001

  • Reported release

    751

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-01-26

  • Closed date

    2011-05-06

  • Last modified date

    2011-05-06

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    RBD EGL FOR COB

  • Fixed component ID

    5724S5001

Applicable component levels

  • R751 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMQ79","label":"Rational Business Developer"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5.1","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
06 May 2011