DB2 - Problembeschreibung
Problem IC97047 | Status: Geschlossen |
DB2 IS ALLOWING PL/SQL ROUTINES TO BE CREATED WHEN VARIABLES FOR THE CURSOR DO NOT MATCH THOSE IN THE FOR LOOP. | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problembeschreibung: | |
PL/SQL routine creation should fail when the variables passed in the cursor statement do not match those in the for loop. Routines created with this syntax will appear to work and will run. However they will not return any data because the loop will not execute as expected. Below is an example of a procedure that will encounter the issue. CREATE OR REPLACE PROCEDURE myproc (p_id in number, p_txt varchar2) is cursor c(c_id in number, c_txt varchar2) is select id, txt from t1 where id = c_id and txt = c_txt; v_txt varchar2(10); begin for r in c loop v_txt := r.txt; dbms_output.put_line(v_txt); end loop; end; In the above example the cursor had two input variables c_id and c_txt while the for loop did not use any variables. For the procedure to work as expected the for loop should have been set as follows. for r in c(p_id, p_txt) loop | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * DB2 LUW * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 LUW V105 fix pack 3 * **************************************************************** | |
Local-Fix: | |
NONE. Modify the routine so that the variables in the FOR LOOP match those in the CURSOR | |
verfügbare FixPacks: | |
DB2 Version 10.5 Fix Pack 3 for Linux, UNIX, and Windows | |
Lösung | |
DB2 LUW v105 fix pack 3 an error SQL0313N will be returned when number of parameters in OPEN statement will not match number of parameters that parametarized cursor was declared with | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 21.10.2013 27.02.2014 27.02.2014 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
Problem behoben lt. FixList in der Version | |
10.5.0.3 | |
10.5.0.3 |