GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 35 of 170    Print  
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.

  
Total Answers and Comments: 3 Last Update: February 06, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 17, 2006 13:14:17   #1  
RACHANA        

RE: What a SELECT FOR UPDATE cursor represent.

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. 


 
Is this answer useful? Yes | No
August 17, 2007 09:13:59   #2  
syam sundar        

RE: What a SELECT FOR UPDATE cursor represent.
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


 
Is this answer useful? Yes | No
February 06, 2008 15:05:58   #3  
g_sidhu Member Since: August 2007   Contribution: 122    

RE: 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 i

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.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape