db2 stored procedure. locking / releasing table
Posted
on Stack Overflow
See other posts from Stack Overflow
Published on 2009-06-11T02:55:43Z
Indexed on
2010/03/21
15:01 UTC
Read the original article
Hit count: 131
db2
I use a stored procedure to read/update/return certain fields in a journaled as400 table. I want to lock the table first and then release it after the record is updated. I tried tons of stuff, but releasing table is a problem. SP defines and opens cursor, selects record into variables and updates the record. I tried 'begin atomic', then lock table in exclusive mode and then when it's over, it doesn't release. Is there any statement i missing or do i need to compile it with certain parameters? I use a simple create procedure statement in AS400 navigator's sql panel to compile it. Will very appreciate some help with example. Thanks.
© Stack Overflow or respective owner