IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Error -904 in a stored procedure with global temporary table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
angelalpe
Warnings : 1

New User


Joined: 22 Sep 2005
Posts: 32

PostPosted: Fri Feb 02, 2007 6:01 pm
Reply with quote

I have a program batch that calls ?many times? to a procedure stored DB2.

In this procedure a temporary table is declared (DECLARE GLOBAL TEMPORARY TABLE SESSION.TABLA) where are inserted registries and in the end a cursor with the registries of the temporary table is given back. Before declaring the temporary table always drop is executed table. The registries that are inserted in the temporary table are not many, between 100 and 200 and the size of each registry is of 400 bytes.

The procedure does not have commit because I need that it is the program batch the one that does commit.

The problem is that after the program batch calls 300 times to the stored procedure, the procedure gives to an error sqlcode=-904 and sqlstate = 57011 when executing the sentence DECLARE GLOBAL TEMPORARY TABLE

Reason why I have seen, the error can be because the temporary storage or the resource of the data base is not available.

It seems that the problem is that whenever the procedure finishes not it releases space (memory) and since I make many calls to the procedure, the occupied memory is growing

Is some way of which when it finishes my procedure frees memory or the resources are freed that use?

Is necessary to increase the size to declare temporary tables?

Which can be my problem and as I can solve it?

Thank you very much and greetings
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Sat Feb 03, 2007 9:23 pm
Reply with quote

angelalpe,

Quote:
Reason why I have seen, the error can be because the temporary storage or the resource of the data base is not available.


U have confined to the rite point, -904 can also occur when a commit is not given especially in store proc., look the issue in this angle, and let us know reg. this

And one more way to look at your req, u are creating a temp.table when ever u r callin the SP and for each and every execution of the SP a temp.table is created this may also increse the memory size of your load module , try to look at the column called STAYRESIDENT inside SYSIBM.SYSROUTINES for your SP, this option can take values 'Y' or 'N', this would release the Load module of your SP once the SP has executed. one more soln. that can be is to drop the created Temp. table at the fag end of yoor SP.

Please Correct me if I am Wrong.

Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Error when install DB2 DB2 2
No new posts Pulling a fixed number of records fro... DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top