Which statements are true regarding the FOR UPDATE clause in a SELECT statement?

Which statements are true regarding the FOR UPDATE clause in a SELECT statement? (Choose all
that apply.)

Which statements are true regarding the FOR UPDATE clause in a SELECT statement? (Choose all
that apply.)

A.
It locks only the columns specified in the SELECT list.

B.
It locks the rows that satisfy the condition in the SELECT statement.

C.
It can be used only in SELECT statements that are based on a single table.

D.
It can be used in SELECT statements that are based on a single or multiple tables.

E.
After it is enforced by a SELECT statement, no other query can access the same rows until a COMMIT or ROLLBACK is issued.



Leave a Reply 13

Your email address will not be published. Required fields are marked *


Surendar

Surendar

Option E is also correct

Justyna

Justyna

Select for update holds the records “for your changes only” so someone else cannot update or delete records but is possible to query rows.

Surendar

Surendar

You can’t perform any DML operations until commit or rollback is given.

Justyna

Justyna

xaclty, but in E is mentioned only about query.

Surendar

Surendar

can we able to use where clause in the select statement which has FOR UPDATE clause?

Justyna

Justyna

yes, you can use.

Surendar

Surendar

Then Opt B is correct right?

Justyna

Justyna

yes, it is correct.

melese

melese

E is also correct answer.
i need reason why choose ‘e’ doesn’t considered as a answer?

noel

noel

Because it says that no other query can access the same rows until the transaction is either committed or rolled back, and that is not true.

select for update prevents changes to be made by other transactions, but they can still see the data as it was at the time of the select for update execution

Nikita Gupta

Nikita Gupta

so option e is also in answer

Prat

Prat

No ‘e’ is not an answer. please see noel’s reply everyone..

Trinux

Trinux

Indeed, “E” is wrong. The Locked rows can be accessed by other users (but not updated, deleted)