home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC76485 Status: Closed

DB2 DOESN'T RECOGNISE A NEW BEGIN-END BLOCK IMMEDIATELY AFTER A LABEL
DECLARATION WHEN INTERPRETING PL/SQL

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
When a BEGIN-END block follows immediately after a label 
declaration in a PL/SQL statement, 
e.g. 
 
------- 
CREATE OR REPLACE PROCEDURE PROC_TEST ( 
  ... 
) IS 
 
  ... 
 
BEGIN 
    ... 
    GOTO LABEL; 
    ... 
<< LABEL >> 
    BEGIN 
    ... 
    END; 
END; 
------- 
 
db2 gives the following error: 
 
DB21034E  The command was processed as an SQL statement because 
it was not a 
valid Command Line Processor command.  During SQL processing it 
returned: 
SQL0104N  An unexpected token "BEGIN" was found following "BEGIN 
".  Expected 
tokens may include:  "SELECT".  LINE NUMBER=XX.  SQLSTATE=42601
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* Interpreting PL/SQL in DB2                                   * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* When interpreting PL/SQL, DB2 does not recognise a BEGIN-END * 
* block that immediately follows a label.                      * 
*                                                              * 
* User will see a message like:                                * 
* DB21034E  The command was processed as an SQL statement      * 
* because it was n                                             * 
* valid Command Line Processor command.  During SQL processing * 
* it returned                                                  * 
* SQL0104N  An unexpected token "BEGIN" was found following "  * 
* BEGIN".                                                      * 
* Expected tokens may include:  "SELECT".  LINE NUMBER=XXX.    * 
* SQLSTATE=42601                                               * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 version 9.7 FP5                               * 
****************************************************************
Local Fix:
Insert a NULL statement between the label and the BEGIN; e.g. 
 
<< LABEL >> 
    NULL; 
 
    BEGIN
available fix packs:
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
18.05.2011
07.12.2011
07.12.2011
Problem solved at the following versions (IBM BugInfos)
9.7.FP5
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.5 FixList