IBM Support

IZ08102: SQL0138N WITH DB2 UDB WITH SUBSTR FUNCTION IN SQL PROCEDURE.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • SQL0138N with DB2 UDB with SUBSTR function in SQL procedure.
    After compilation with REOPT ALWAYS, during the call error
    occurs.
    The error occurs if the input literal parameter is shorter than
    that of the parameter and a substr() function is trying to
    reference the part of the parameter that is beyond the length of
    the literal string.
    
    For example:
        call SYSPROC.SET_ROUTINE_OPTS('REOPT ALWAYS') #
    
        create procedure P1(in S varchar(7))
        begin
          if substr(S, 7, 1) <> '#' then
            signal sqlstate '70001';
          end if;
        end #
    
        -- returns incorrect SQL0138N
        call P1('abcdef') #
    
    The same error results if substr(S,7,1) is relaced by
    substr(S,6,2), substr(5,3), etc.
    
    
    Value of output parameters
    Parameter Name  : @ERROR
    Parameter Value : -727
    Parameter Name  : @PARAMS
    Parameter Value : SQL0727N  An error occurred during implicit
    system
    action type "6".  Information returned for the error includes
    SQLCODE
    "-138", SQLSTATE "22011" and message tokens "".  SQLSTATE=56098
    Parameter Name  : @DEBUG
    Parameter Value : STEP-volitelna
    Return Status = 0
    
    db2diag.log output:
    329187  entry DB2 UDB SW- query graph sqlnq_encap_doit fnc
    (1.3.60.527.0)
            pid 565538 tid 1 cpid 3408 node 0 sec 6 nsec 644283131
    
    329188  data DB2 UDB SW- query graph sqlnq_encap_doit fnc
    (3.3.60.527.0.8)
            pid 565538 tid 1 cpid 3408 node 0 sec 6 nsec 644283799
    probe 8
            bytes 49
            encap for SQLNQ_ENCAP_SHORT_SUBSTR_W_LEN
    
    
    .  .  .
    
    329194  exit DB2 UDB SQO Memory Management sqlogmblkEx cei
    (2.3.129.45.2)
            pid 565538 tid 1 cpid 3408 node 0 sec 6 nsec 644286361
            rc = 0
            bytes 16
    
            Data1   (PD_TYPE_MEM_ADJUSTED_SIZE,8) Adjusted block
    size:
            160
    
    329195  exit DB2 UDB mem optimization sqlmoAllocBlock cei
    (2.3.81.1.2)
            pid 565538 tid 1 cpid 3408 node 0 sec 6 nsec 644286626
            rc = 0
    
    329196  entry DB2 UDB SW- common services sqlnn_erds fnc
    (1.3.49.21.0)
            pid 565538 tid 1 cpid 3408 node 0 sec 6 nsec 644287407
    
    329197  data DB2 UDB SW- common services sqlnn_erds fnc
    (3.3.49.21.0.0)
            pid 565538 tid 1 cpid 3408 node 0 sec 6 nsec 644289003
    probe 0
            bytes 70
            CompID= 60, FcnId= 527, sqlCode= -138, loc= 510,
    numTokens= 0
    

Local fix

  • N/A
    

Problem summary

  • see problem description
    

Problem conclusion

  • First fixed in DB2 UDB Version 9.5, FixPak 1
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ08102

  • Reported component name

    DB2 UDB ESE AIX

  • Reported component ID

    5765F4100

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2007-11-06

  • Closed date

    2008-05-30

  • Last modified date

    2008-05-30

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

    IY94641

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

Fix information

  • Fixed component name

    DB2 UDB ESE AIX

  • Fixed component ID

    5765F4100

Applicable component levels

  • R910 PSY

       UP

  • R950 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
30 May 2008