Re: rollback while updation

Re: rollback while updation

 

  

Hi Sourav,

Pleasure to meet you! You didn't say if your process was outside or inside DB2; your coding technique may or may not change. Options:

1. Issue a "lock table tab_name in share mode" command against your target table prior to building your resultset. That will give you a better chance of being able to update successfully. Regardless, after every update statement, trap the SQLCODE immediately after your update statement. For anything other than a 0, branch to an error handling routine in your process, do whatever you need to do there, then return to your loop thereby bypassing the row that failed and continue on.
2. If you're running your updates during off-peak hours, issue a lock table in exclusive mode command against your target table prior to building your resultset. Check your return code immediately for success; based on the return code, you'll know what to do in your process.

Nick

-------------- Original message --------------
From: "saurav_mukherjee" <db2udbdba-ezmlmshield-x6094744.[Email address protected]

> Hi All,
>
> I'm having a temp table from which i'm fetching all the data and using a
> cursor within a for loop I'm tryin to update another table.
> Now prob is that in the updatable table if there is/are any row level
> lock, the whole updation is getting rollback.
> In this case I want to ignore the row level locked rows and update others.
>
> Ny suggestions??
>
> Regards,
> Sourav
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>

DB2 & UDB email list listserv db2-l LazyDBA home page