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

Inserting into Global temporary table


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

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Tue Mar 25, 2008 11:04 am
Reply with quote

Hi,

I have an insert statement in my program.
INSERT INTO SESSION.LOOKUPTAB

(GTLKUP_DEP_BLL_BAS,
GTLKUP_RATE_TYPE,
GTLKUP_BAC_COVER
)

VALUES
(:TRBNDCD-DEPS-BEN-BIL-BAS,
:TRBNDCD-RATE-TYPE,
:TRBNDCD-BAC-COVERS

)
Values are available for all the three host variables and the SQLCODE returned is +000000. But when i used a selest query
SELECT GTLKUP_DEP_BLL_BAS,GTLKUP_RATE_TYPE,
GTLKUP_BAC_COVER INTO :TMP-DEP-BLL,
:TMP-RATE-TYPE,:TMP-BC-CVR
FROM SESSION.LOOKUPTAB
to view the content of the table, i found that nothing was inserted into the temporary table.

I dont know what is the problem with insert....
Can any one please help me..

Thanks in advance.
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Tue Mar 25, 2008 4:25 pm
Reply with quote

Please check the below link

ibmmainframes.com/about123.html

the default, is ON COMMIT DELETE ROWS. In that case all of the rows of the table are deleted as long as there are no cursors defined using WITH HOLD.


also Issue a commit statement after insert
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Tue Mar 25, 2008 4:28 pm
Reply with quote

Additional link :
==========

decipherinfosys.wordpress.com/2007/05/05/temporary-tables-db2-luw/
Back to top
View user's profile Send private message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Tue Mar 25, 2008 5:07 pm
Reply with quote

Hi siva,

I have already used both "ON COMMIT PRESERVE ROWS" and "COMMIT" after insert statement. Then also its not working.

And iam not using any cursor.

What to do now?
How to resolve this problem?
Iam not able to progress.
Please anyone help me..
Back to top
View user's profile Send private message
birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Tue Mar 25, 2008 5:53 pm
Reply with quote

Simple. Use display statement after insert and before select
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top