How can you lock rows in a table with SELECT query? If another user has already locked those rows, what wil happen if you try to lock them also? Is there any way to avoid the situation?

What will be an ideal response?


Use SELECT statement with FOR UPDATE OF clause.
The user trying to lock rows goes into wait state, and cannot do anything until the first
user with lock removes it.
NOWAIT clause tells you if rows are already locked by another user, and brings you to
SQL> prompt again to continue session.

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. A text file cannot be open both for input and for output at the same time. 2. Before a text file can be opened for input, it must already exist on a disk. 3.Before a text file can be opened for append, it must already exist on a disk. 4 If any record in a text file is to be changed, the entire file must be rewritten. 5. A Try block must contain either an Except block or a Finally block.

Computer Science & Information Technology

By default, text in a cell is oriented ________, so that it reads from left to right

Fill in the blank(s) with correct word

Computer Science & Information Technology

?What operator below is known as the NOT operator?

A. ?-o B. ?-a C. ?! D. ?%

Computer Science & Information Technology

What are the differences between using a the increment and decrement unary operators as prefix operators versus using them as postfix operators??

What will be an ideal response?

Computer Science & Information Technology