DB2 - Problembeschreibung
Problem IC69790 | Status: Geschlossen |
PL/SQL: CONTINUE STATEMENT IN FOR LOOP CAUSES INFINITE LOOP. | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
If PL/SQL contains CONTINUE statement in FOR loop, it stops responding (hangs). The following steps illustrates one of the scenario causing this problem. 1. Create a Oracle compatible database. $ db2set DB2_COMPATIBILITY_VECTOR=ORA $ db2stop $ db2start $ db2sampl 2. Create a PL/SQL procedure. $ db2 connect to sample $ db2 set sqlcompat plsql $ db2 -tvf p1.sql ------------------------------ create or replace procedure P1 is begin for r in 1..5 loop CONTINUE when r=3; dbms_output.put_line(r); end loop; end; / ------------------------------ 3. Run the procedure. $ db2 set serveroutput on $ db2 call P1 The procesure call never returns, but the user can interrupt it by Ctrl+C. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * users who use PL/SQL with CONTINUE statement in FOR LOOP. * **************************************************************** * PROBLEM DESCRIPTION: * * If PL/SQL contains CONTINUE statement in FOR loop, it stops * * responding (hangs). * * The following steps illustrates one of the scenario causing * * this problem. * * * * 1. Create a Oracle compatible database. * * $ db2set DB2_COMPATIBILITY_VECTOR=ORA * * $ db2stop * * $ db2start * * $ db2sampl * * * * 2. Create a PL/SQL procedure. * * $ db2 connect to sample * * $ db2 set sqlcompat plsql * * $ db2 -tvf p1.sql * * ------------------------------ * * create or replace procedure P1 * * is * * begin * * for r in 1..5 loop * * CONTINUE when r=3; * * dbms_output.put_line(r); * * end loop; * * end; * * / * * ------------------------------ * * * * 3. Run the procedure. * * $ db2 set serveroutput on * * $ db2 call P1 * * * * The procesure call never returns, but the user can interrupt * * it by Ctrl+C. * **************************************************************** * RECOMMENDATION: * * Please upgrade to V9.7 fixpack 4 or later. * **************************************************************** | |
Local-Fix: | |
Please rewrite the PL/SQL procedure like as below: create or replace procedure P1 is begin for r in 1..5 loop if r=3 then goto LOOP_END; end if; dbms_output.put_line(r); <<LOOP_END>> null; end loop; end; / | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows | |
Lösung | |
This problem is first fixed in DB2 V9.7 fixpack 4. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 09.07.2010 12.05.2011 12.05.2011 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP4 | |
Problem behoben lt. FixList in der Version | |
9.7.0.4 |