Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Inserting into Global temporary table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Inserting into Global temporary table
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: 190
Location: hyderabad

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

Please check the below link

http://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: 190
Location: hyderabad

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

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

http://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    Post subject: Reply to: Inserting into Global temporary table
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    Post subject: Reply to: Inserting into Global temporary table
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us