Geeks Talk

Prepare for your Next Interview




For update clause

This is a discussion on For update clause within the Oracle forums, part of the Databases category; Hi, If a transaction is updating data in a database, it gets an exclusive lock on that part of the database automatically. Then what is the use of for update ...


Go Back   Geeks Talk > Databases > Oracle

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-02-2008
Contributing Member
 
Join Date: Mar 2008
Posts: 81
Thanks: 14
Thanked 3 Times in 3 Posts
babi_geek is on a distinguished road
For update clause

Hi,

If a transaction is updating data in a database, it gets an exclusive lock on that part of the database automatically. Then what is the use of for update clause defining it explicitly?


Regards
Babi

Last edited by babi_geek : 03-02-2008 at 10:34 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-03-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,426
Thanks: 8
Thanked 125 Times in 112 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: For update clause

That is used with Select statement to explicitly enforce a lock .
Reply With Quote
  #3 (permalink)  
Old 03-03-2008
Junior Member
 
Join Date: Feb 2008
Location: Edinburgh
Posts: 21
Thanks: 3
Thanked 2 Times in 2 Posts
su123 is on a distinguished road
Re: For update clause

Hi babi,
If a transaction is updating data in a database, it gets an exclusive lock on that part of the database automatically. Up to this the Question is good After that you typed "Then what is the use of for update clause defining it explicitly?" can you retype the Question clearly.
Reply With Quote
  #4 (permalink)  
Old 03-19-2008
Junior Member
 
Join Date: Mar 2008
Location: Bangalore
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
savitha239 is on a distinguished road
Re: For update clause

Hi,
For Update clause is always used in a cursor(or a simple SELECT statement).

The advantage of locking a set of rows fetched by cursor(or a select statement) over an exclusive lock on an update or delete transaction is,
the set of SELECTED rows can be locked before u can modify so that denying the modification of the same set of rows by other user.

Thanks,
Savitha
Reply With Quote
Reply

  Geeks Talk > Databases > Oracle


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
GROUP_BY and HAVING clause in SQL nancyphilips SQL 5 09-09-2008 12:39 AM
Pass periodic value into where clause sheker2007 Oracle 1 10-30-2007 08:55 AM
return clause in cursor Barbie Oracle 4 01-31-2007 05:46 AM
Writeing a query with HAVING clause JobHelper SQL 2 01-11-2007 12:41 AM
Presence of Clause nehalshah MainFrame 1 10-09-2006 04:01 PM


All times are GMT -4. The time now is 03:53 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved