Page 1 of 1

Updated row in DB2 through SPUFI, can we undo this?

Posted: Tue Dec 01, 2015 2:58 pm
by Ashish Mathew
Hi,

I have updated row in DB2 using SPUFI, now how can I revert these changes which I have just done? Is there a way to do it?

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Tue Dec 01, 2015 4:47 pm
by Anuj Dhawan
Short answer is - it depends. And it depends if the COMMIT is executed or not.

Remember SPUFi is a tool. In SPUFI, you can set the defaults where it will prompt you before COMMIT. I leave it on you to check where the option is located - however, you can select AUTOCOMMIT as '?' or 'N'. If you specify '?' SPUFI will ask you to commit at the end, where you can choose not to commit. But if you choose to COMMIT, running other SQL query using the "pre-COMMIT" values is the only solution I can think of.

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Wed Dec 02, 2015 12:37 pm
by Ashish Mathew
Thanks Anuj. Setting up AUTOCOMMIT as 'to 'N' is what I am using now.

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Wed Dec 02, 2015 1:42 pm
by Anuj Dhawan
Glad, you've got it working.

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Wed Dec 02, 2015 2:16 pm
by enrico-sorichetti
just remember that using AUTOCOMMIT N will lock the updated rows for the rest of the SPUFI session
or until You force a commit with the proper command

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Mon Dec 07, 2015 11:43 am
by Ashish Mathew
Thanks enrico. You mean to it will lock the row for other users? But once the query is executed successfully, the COMMIT will happen automatically?

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Mon Dec 07, 2015 12:45 pm
by enrico-sorichetti
You mean to it will lock the row for other users?
YES
But once the query is executed successfully, the COMMIT will happen automatically?
we are in a loop here ...
if the commit happened automatically we would be back to the situation You wanted to avoid.

Re: Updated row in DB2 through SPUFI, can we undo this?

Posted: Tue Dec 08, 2015 11:06 am
by Ashish Mathew
yes... I forgot the main question in the process of learning.. :?