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 | |
| 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 |
|