If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > 'On commit delete rows' option when declaring temp table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-08, 14:57
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
'On commit delete rows' option when declaring temp table

Hello,

Please tell me if I'm correct in assuming that the two declaration statements are the same... if I don't give 'ON COMMIT DELETE ROWS' will it still delete rows from the temp table or keep them there? Thank you!

DECLARE GLOBAL TEMPORARY TABLE TMPVALUES (
ID INTEGER,
RVAL DOUBLE
) ON COMMIT DELETE ROWS NOT LOGGED IN USERTMP_TBLSP;




DECLARE GLOBAL TEMPORARY TABLE TMPVALUES (
ID INTEGER,
RVAL DOUBLE
) NOT LOGGED IN USERTMP_TBLSP;
Reply With Quote
  #2 (permalink)  
Old 07-09-08, 15:20
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Since ON COMMIT DELETE ROWS is above the line in the syntax diagram (http://publib.boulder.ibm.com/infoce...r0003272.html), it is the default. Thus, the two statements you posted are semantically equivalent. See also: http://publib.boulder.ibm.com/infoce.../r0006726.html

However, I would always prefer the explicit approach because it makes things obvious for others and they don't have to dig into the manual to understand what will happen.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 07-09-08, 15:27
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
thank you..!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On