Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    123

    Unanswered: '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;

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    Join Date
    Dec 2002
    Posts
    123
    thank you..!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •