IBM Support

IC88573: DECIMAL VALUES ARE INCORRECTLY RETURNED BY A STORED PROCEDURE

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • if you have LANG set to a locale that uses a character other
    than '.' as the decimal point, the decimal values returned by a
    stored procedure are incorrect.
    
    example :
    
    more repro.sql :
    
    create table t1  (c1 real);
    insert into t1 values (1)
    ;
    
    
    CREATE PROCEDURE sp1 ( IN stmt1 VARCHAR(4000) )
        SPECIFIC sp1
        RESULT SETS 1
        LANGUAGE SQL
    P1: BEGIN
        DECLARE c1 CURSOR WITH RETURN FOR s1
        PREPARE s1 FROM stmt1
        OPEN c1
    END P1
    ;
    call sp1('select * from t1');
    select * from t1;
    
    
    export LANG=fr_FR.ISO8859-1
    db2start
    db2 create database sample
    
    db2 -tvf sp1.sql
    ....
    call sp1('select * from sp1_t1')
    
    
      Ensemble de rツsultats 1
      --------------
    
      C_REAL
      ------------------------
                 +0,00000E+000
    
      1 enregistrement(s) sツlectionnツ(s).
    
      Etat du retour = 0
    
    select * from sp1_t1
    
    C_REAL
    ------------------------
               +1,00000E+000
    
      1 enregistrement(s) sツlectionnツ(s).
    
    The same problem could also be seen if a stored procedure has
    output parameters of type Real.
    e.g:
    db2 "create table sp3_t1(c_real real)";
    db2 "insert into sp3_t1 values(3.787878)"
    db2 "CREATE PROCEDURE sp3 (  out outcol real )
                SPECIFIC sp3
                RESULT SETS 1
                LANGUAGE SQL
    
            P1: BEGIN
                Select c_real into outcol from sp3_t1;--
            END P1"
    
    
    db2 "call sp3(?)"
    
      Value of output parameters
      --------------------------
      Parameter Name  : OUTCOL
      Parameter Value : +0,00000E+000
    
      Return Status = 0
    
    db2 "select * from sp3_t1"
    
    C_REAL
    ------------------------
               +3,78788E+000
    
      1 record(s) selected.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * DB2 LUW                                                      *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 9.7 FP8                                       *
    ****************************************************************
    

Problem conclusion

  • The problem is first fixed in DB2 9.7 FP8
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC88573

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-11-27

  • Closed date

    2013-05-02

  • Last modified date

    2013-05-02

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

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

    IC91734

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSY

       UP

  • RA10 PSY

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC88573

Modified date: 02 May 2013