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

DB2 Temporary Table: -805 error and Missing Data


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

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Tue Dec 22, 2009 7:21 am
Reply with quote

Hello,

I have 2 programs, Program A and B. Program A calls Program B. Program B inserts records in a TEMPORARY TABLE. After calling Program B, Program A will load the data inserted in the TEMPORARY table to a cursor. My questions are:

a. What could be the reason why im getting a -805 when i tried to OPEN the declared cursor for the temporary table in Program A?

b. Does a DB2 temporary table looses its contents after program execution? I was able to verify that records are being inserted in the temporary table but after program execution and i used spufi, the inserted records are already gone.

Thanks,
Chris
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 22, 2009 7:42 am
Reply with quote

use IBM's LookAt Website to see what a -805 indicates and solve that problem, which will probably solve your other problem.

you should also read about temporary tables (Global, GTT) there are 3 types.
Since you did not tell us which type,
we have no idea what the problem is.

No,
I lied,
actually,
we do,
but I think it would be in your best interest to learn about temporary tables.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Dec 22, 2009 12:09 pm
Reply with quote

sprikitik wrote:
Hello,

I have 2 programs, Program A and B. Program A calls Program B. Program B inserts records in a TEMPORARY TABLE. After calling Program B, Program A will load the data inserted in the TEMPORARY table to a cursor. My questions are:

a. What could be the reason why im getting a -805 when i tried to OPEN the declared cursor for the temporary table in Program A?

b. Does a DB2 temporary table looses its contents after program execution? I was able to verify that records are being inserted in the temporary table but after program execution and i used spufi, the inserted records are already gone.

Thanks,
Chris


a. There are simpler reasons for -805 and the temp table has nothing to do with it.

b. Yes. That is the property of temp tables.
Back to top
View user's profile Send private message
ajeshrn

New User


Joined: 25 Mar 2009
Posts: 78
Location: India

PostPosted: Thu Dec 24, 2009 11:39 am
Reply with quote

Hi sprikitik

I dont think the reason for you getting -805 would be related to your Global Temporary Table.Please check whether the Bind Package and Plan has been successful in the above programs.

Yes, for your second question. The Global Temporary Table will be dropped when the Program conrtol is lost. Incase if you are trying to get the data from Program B GTT and displaying the content in Program A, then try using ON COMMIT PRESERVE ROWS while you declare the GTT.

Please do refer the docs given by dbz
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
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
Search our Forums:

Back to Top