View previous topic :: View next topic
|
Author |
Message |
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
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 |
|
|
ajeshrn
New User
Joined: 25 Mar 2009 Posts: 78 Location: India
|
|
|
|
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 |
|
|
|