What a SELECT FOR UPDATE cursor represent.[ANSWER]SELECT......FROM......FOR......UPDATE[OF column-reference][NOWAIT] The processing done in a fetch loop modifies the rows that have been retrieved by the cursor. A convenient way of modifying the rows is done by a method with two parts: the FOR UPDATE clause in the cursor declaration, WHERE CURRENT OF CLAUSE in an UPDATE or declaration statement.

Showing Answers 1 - 10 of 10 Answers

RACHANA

  • Feb 17th, 2006
 

SELECT FOR UPDATE  - when using this clause rdbms automatically obtains exclusive row level locks on all rows indentified by select statements' result set. noone else can modify these row except you until you comit or rollback.

Where Current of clause gives access to recently fetched row/record of cursor. 

  Was this answer useful?  Yes

syam sundar

  • Aug 17th, 2007
 

SELECT FOR UPDATE is a clause in the cursors

When you use this within the cursor it will be lock all affected rows. Any one except you can not modify the rows until & unless commit or rollback

  Was this answer useful?  Yes

g_sidhu

  • Feb 6th, 2008
 

The SELECT ... FOR UPDATE statement identifies the rows that will be updated or deleted, then locks each row in the result set. This is useful when you want to base an update on the existing values in a row. In that case, you must make sure the row is not changed by another user before the update.

FOR UPDATE clause in the cursor query is used to lock the affected rows when the cursor is opened. Because the Oracle Server releases locks at the end of the transaction, you should not commit across fetches from an explicit cursor if FOR UPDATE is used.

Nicsmart

  • Mar 31st, 2010
 

The SELECT....FOR UPDATE [OF column_reference ][NOWAIT] statement identifies the rows that will be updated or deleted, then locks each row in the result set. This is useful when we want to base an update on an existing value in a row.

In that case we must make sure that that value in not changed by any user before the update.  NOWAIT keyword tells Oracle not to wait if the requested rows are locked by some other user.  Control is immediately returned to our program so that it can do other work before trying to acquire locks. If NOWAIT keyword is ommited Oracle waits untill rows are available.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions