Which two are true about using the FOR UPDATE clause in a SELECT statement? (Choose two.)
Which two are true about using the FOR UPDATE clause in a SELECT statement? (Choose two.)
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.
BE is correct
B E are correct
B - can SELECT FOR UPDATE be used with DISTINCT? I receive ORA-01786 error when testing
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.
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.
My bad, the alternative says CANNOT I mistakenly read CAN. Sorry.