DB2 - Problembeschreibung
Problem IC95441 | Status: Geschlossen |
SQL0206N ERROR REFERENCING COLUMN RETURNED FROM AN ASSOCIATIVE ARRAY OF RECORDS IN ORACLE COMPATIBILITY MODE | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problembeschreibung: | |
When trying to reference a column returned from an associative array of records in Oracle compatibility mode, the following error may occur: select * from table (p1.mytabfunc()) where f1 > 10 SQL0206N "F1" is not valid in the context where it is used. SQLSTATE=42703 This occurs because the columns in the function are being returned as system generated names such as 1, 2, 3 instead of the original name such as "F1". The function must return a array of records, as in this example: create or replace package p1 as type myrec is record ( f1 number(5), f2 varchar(10) ); type mycoll is table of myrec index by binary_integer; function mytabfunc return mycoll; end; describe select * from table (p1.mytabfunc()) Column Information Number of columns: 3 SQL type Type length Column name Name length -------------- ----------- ------------ ----------- 497 INTEGER 4 1 1 485 DECIMAL 5, 0 2 1 449 VARCHAR 10 3 1 | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * DB2 LUW * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 10.5 Fix Pack 3. * **************************************************************** | |
Local-Fix: | |
As a workaround, the SQL statement can be re-written to rename the columns using the "AS" clause such as below: select * from table (p1.mytabfunc()) as t (idx, field1, field2) where field1 > 1 | |
verfügbare FixPacks: | |
DB2 Version 10.5 Fix Pack 3 for Linux, UNIX, and Windows | |
Lösung | |
This problem is first fixed in DB2 Version 10.5 Fix Pack 3. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 27.08.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 |