728x90

DB2에서 오라클 호환모드를 사용할 때, PL/SQL에서 오라클 방식으로 VARCHAR ARRAY ( VARRAY )  타입의 데이터를 오라클 스타일로 초기화할 때 발생하는 오류에 대한 해결방법입니다. DB2에서 VARRAY 데이터 타입을 오라클 스타일로 초기화하려고 하면 함수로 인식해 SQL0440N 오류가 발생합니다.


Problem(Abstract)

A PL/SQL array constructor statement with the syntax as seen below, fails in DB2 with error SQL0440N 

For e.g.
v_List va1.t_Strings := va1.t_Strings('Harry', 'Ron', 'Hermione');
SQL0440N No authorized routine named routine-name of type routine-type having compatible arguments was found

Symptom

Error SQL0440N will be returned when a PL/SQL containing an array constructor is run in DB2.


Cause

DB2 does not support PL/SQL array constructor syntax, and therefore ends up trying to interpret the array constructor as a function call(routine).
However since it does not find a matching routine name corresponding to this, it ends up throwing the SQL0440N error.

Diagnosing the problem

If SQL0440N is returned when the PL/SQL statement is executed, then this issue can be confirmed by examining the PL/SQL to see if it uses an array constructor to initialize an array.

Resolving the problem

Workaround : 
Instead of using an array constructor to initialize the array, ie. instead of doing : 
v_List va1.t_Strings := va1.t_Strings('Harry', 'Ron', 'Hermione');

we can initialize the array as follows : 
v_List(1) := 'Harry';
v_List(2) := 'Ron';
v_List(3) := 'Hermione';


http://www-01.ibm.com/support/docview.wss?uid=swg21608791

728x90

+ Recent posts