Cursors for updating
Using CURSOR our COBOL program can gain access to individual row of the result table 1.
Row-set positioned cursor : Here the result table are stored into Host variable arrays. Row-positioned cursor : This type points to the current row/particular row in the result set. Fetch each row ,one at a time, and pass it onto application program Step4: Close the cursor. It simply forms the SQL statement we want to use to fetch the data.
Had it been a spufi or QMF we have our update and delete statements ready to run and modify. Nevertheless we can do the same modifications using cursors again.!!Where a connection does exist is that all cursors are closed at ROLLBACK and non-holdable cursors are closed at COMMIT (holdable cursors are kept open after the commit).-- Knut Stolze DB2 Information Integration Development IBM Germany Thanks, Mark. The following is the best solution and will avoid deadlocks: -- increment the sequence number and hold exclusive lock on the row UPDATE sequence_table SET seq_number = seq_number 1 WHERE seq_key = ?Could you please explain to me why someone would want to get an an exclusive lock on the rows that are to be deleted ?Do we care if someone tries to update them at the same time ?