The following problem occurs only when a query is executed for the view whose field definition depends on the function XMLQUERY multiple times.
SQL10003C -There are not enough system resources to process the request. The request cannot be processed.
Consider I have a view VIEW_TABLE_TEST. Also consider the view definition for the following two fields in VIEW_TABLE_TEST .
FIELD1 - XMLCAST(XMLQUERY('$d/row/c6[position()=1]' passing b.XMLRECORD as "d") as VARCHAR(4000))
FIELD2 - testget(a.RECID, '-', '1', '1')
So when I execute the Query “SELECT RECID FROM VIEW_TABLE_TEST WHERE FIELD2 ='1031'” any number of times,everything works fine since the field CUSTOMER_NUMBER depends on the user defined function testget.
But when I execute the Query “SELECT RECID FROM VIEW_TABLE_TEST WHERE FIELD1 ='US'” several times, I get this problem since the field FIELD1 depends on the function XMLQUERY.So each time the above query is executed, the memory occupied by the process db2sycs(The main DB2 system controller or engine) keeps on increasing. When it reaches the point where no more memory can be allocated , I get this problem.
Is this a problem with XMLQUERY function?