IBM Support

IC87366: SQL0644N ON STATEMENTS AFTER SELECT WITH STMTCONCENTRATOR=LITERALS & CURSORHOLD=1

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When CURSORHOLD=1 (which is the default) and
    STMTCONCENTRATOR=LITERALS is set in the db2cli.ini file, an
    SQL0644N error may occur when a select statement is ran followed
    by another statement that is not a select statement.  The WITH
    HOLD clause is being incorrectly appended to the subsequent
    non-select statement and is causing the SQL0644N error.
    
    The following is an example of the error.
    
    quickc 1 1 sample
    SQLAllocHandle SQL_HANDLE_STMT 1 1
    SQLExecDirect 1 "SELECT * FROM DEPT where deptno = 'A00'"
    SQL_NTS
    fetchall 1
    SQLFreeStmt 1 SQL_UNBIND
    SQLFreeStmt 1 SQL_RESET_PARAMS
    SQLFreeStmt 1 SQL_CLOSE
    SQLTransact 1 1 SQL_COMMIT
    SQLFreeStmt 1 SQL_UNBIND
    SQLFreeStmt 1 SQL_RESET_PARAMS
    SQLFreeStmt 1 SQL_CLOSE
    SQLExecDirect 1 "LOCK TABLE DEPT IN EXCLUSIVE MODE" SQL_NTS
    SQLGetDiagRec SQL_HANDLE_STMT 1 1
    
    Output:
    
    $ db2cli < script.txt
    IBM DATABASE 2 Interactive CLI Sample Program
    (C) COPYRIGHT International Business Machines Corp. 1993,1996
    All Rights Reserved
    Licensed Materials - Property of IBM
    US Government Users Restricted Rights - Use, duplication or
    disclosure restricted by GSA ADP Schedule Contract with IBM
    Corp.
    > SQLAllocEnv: rc = 0 (SQL_SUCCESS)
                 CLI henv = 1, Test Driver henv = 1
    SQLAllocConnect: rc = 0 (SQL_SUCCESS)
                 CLI hdbc = 1, Test Driver hdbc = 1
    SQLConnect: rc = 0 (SQL_SUCCESS)
    > SQLAllocHandle: rc = 0 (SQL_SUCCESS)
                  CLI handle = 1, Test Driver handle = 1
    > SQLExecDirect: rc = 0 (SQL_SUCCESS)
    > FetchAll:  Columns: 5
      DEPTNO DEPTNAME MGRNO ADMRDEPT LOCATION
      A00, SPIFFY COMPUTER SERVICE DIV., 000010, A00, -
    FetchAll: 1 rows fetched.
    > SQLFreeStmt: rc = 0 (SQL_SUCCESS)
    > SQLFreeStmt: rc = 0 (SQL_SUCCESS)
    > SQLFreeStmt: rc = 0 (SQL_SUCCESS)
    > SQLTransact: rc = 0 (SQL_SUCCESS)
    > SQLFreeStmt: rc = 0 (SQL_SUCCESS)
    > SQLFreeStmt: rc = 0 (SQL_SUCCESS)
    > SQLFreeStmt: rc = 0 (SQL_SUCCESS)
    > SQLExecDirect: rc = -1 (SQL_ERROR)
    > SQLGetDiagRec: rc = 0 (SQL_SUCCESS)
    SQLGetDiagRec: SQLState     : 42615
              fNativeError : -644
              szErrorMsg   : [IBM][CLI Driver][DB2/6000] SQL0644N
    Invalid value specified for keyword "WITH" in statement
    "<ATTRIBUTE-STRING>".  SQLSTATE=42615
    
              cbErrorMsg   : 132
    >
    Memory count is 45
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 v9.7 Fix Pack 8                               *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 v9.7 Fix Pack 8
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC87366

  • 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-10-19

  • Closed date

    2013-04-19

  • Last modified date

    2013-04-19

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

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

    IC89720

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC87366

Modified date: 19 April 2013