Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 159

Which two are true about using the FOR UPDATE clause in a SELECT statement? (Choose two.)

    Correct Answer: B, E

    The FOR UPDATE clause in a SELECT statement cannot be used with the DISTINCT keyword as it would cause an ORA-01786 error. Additionally, it can be used with joins, allowing the statement to lock rows returned by the join operation, ensuring that these rows can be updated in subsequent transactions.

Discussion
lucemqyOptions: BE

BE is correct

XTIMONOptions: BE

B E are correct

DarnunOptions: BC

B - can SELECT FOR UPDATE be used with DISTINCT? I receive ORA-01786 error when testing

Darnun

BE are correct. C - FALSE. NOWAIT will not acquire locks from their owning transactions, but will not wait until they are released. If rows are already locked by other transaction (e.g. by UPDATE), then with NOWAIT parameter the ORA-00054 error will be thrown.

mrcsp

B is WRONG From Oracle SQL Reference: Restrictions on the FOR UPDATE Clause This clause is subject to the following restrictions: • You cannot specify this clause with the following other constructs: the DISTINCT operator, CURSOR expression, set operators, group_by_clause, or aggregate functions.

mrcsp

My bad, the alternative says CANNOT I mistakenly read CAN. Sorry.