Results 1 to 4 of 4

Thread: For update clause

  1. #1
    Contributing Member
    Join Date
    Mar 2008
    Answers
    66

    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.

  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: For update clause

    That is used with Select statement to explicitly enforce a lock .


  3. #3
    Junior Member
    Join Date
    Feb 2008
    Answers
    15

    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.


  4. #4
    Junior Member
    Join Date
    Mar 2008
    Answers
    2

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact