I am executing the following statement where TEMpGroup belongs to Db2 Database2(TempDB) and Group_view resides in DB2 Database1(Sample).

insert into TEMpGroup(carrierdrid,name,effectivedate,id) select * from group_view.

When run independently, group_view view fetches 17000 records out of a table having 10 million records.

But in the above statement it throws the following error

SQL1822N Unexpected error code "23522" received from data source
"TempDB". Associated text and tokens are "func="SQLExecute"
msg=" SQL0359N The range of values for".

Explanation:

While referencing a data source, the federated server received an
unexpected error code from the data source that does not map to a
DB2 equivalent.

Possible error codes include:

o 4901 Trying to open more than 15 cursors

o 4902 Row size exceeds 32K limit



This error might also be returned if the data source is not
available.

User Response:

Ensure the data source is available, then identify and correct
the root cause of the problem by locating the appropriate message
text and corrective action for the specified error at the data
source.

sqlcode : -1822

sqlstate : 560BD

-----------------------------------------------------------------

with smaller sized table having 10000 records, the above SQL statement
works fine. But when operated on a large table, the caching problem occurs. How to solve the cursor related data buffering issues?
Appreciate your help.