Page 1 of 1

Issues with Declare Global Temporary Tables

PostPosted: Mon Dec 13, 2010 10:23 am
by upendra_water
I am facing SQLCODE -905 with Declare Global Temporary Table (i.e. DGTT)
In a stored procedure we fetch data from multiple tables using a multifetch. This data is inserted into a DGTT and then it is passed to a different stored procedure for generating a report. We faced an issue when the number of records fetched were = 12597.
The stored procedure executed for a very long time and finally it failed with SQLCODE -905.

Has anyone faced this issue before? If yes,can you please suggest a work around?

Re: Issues with Declare Global Temporary Tables

PostPosted: Tue Dec 14, 2010 7:33 pm
by GuyC
yes, -905 is not so rare.
we solved it by reading the manual and taking the appropriate action:

Programmer Response: Determine why this SQL statement or stored procedure
took so long and take appropriate action. Consider simplifying the SQL
statement, restructuring tables and indexes, or contacting the
installation group responsible for maintaining the resource limit
specification tables.

in plain english : Tune your stored Procedure or set a higher limit.