Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012

    Unanswered: Selecting the last commited values


    How can I select the last commited value from a table? I have updated this value multiple times but would like to read the last commited value. I can not store the last commited value in a variable as the multiple procedures and packages are updating and selecting from this table and I cannot pass on this value as parameter. Also is there a way using which i can capture the total number of inserts that got commited when commit was executed.

  2. #2
    Join Date
    Aug 2011
    In SP you can get affected rows by,

    GET DIAGNOSTICS <#rowcount> = ROW_COUNT;

    on CLP something like this.

    db2 -m "insert into hello values(1)"
    Number of rows affected : 1
    DB20000I The SQL command completed successfully.

Posting Permissions

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