Question : foreign key

Can you insert into a parent table when the child table is locked?

Answer : foreign key

I went looking for what version had what and found this

In Oracle 7.1.6 and higher, INSERT into the parent table do not lock the child table. In Oracle 9.0.1 or higher, those locks became temporal: they are only needed during the execution time of the UPDATE/DELETE statements. Those locks are  downgraded to 'mode 3 Row-X (SX)' locks when the execution is finished.  In 9.2.0, the downgraded 'mode 3 Row-X (SX)' locks are no longer required  except when deleting from a parent table with a 'delete cascade' constraint. In 9.2.0 onwards, Oracle requires 'mode 2 Row-S (SS)' locks on the  child table for any DELETE/UPDATE issued against the parent table when an index on the foreign key column of the child table is defined. There will be a ROW-X (SX) lock taken on the child table for an DELETE issued against the parent table when no index on the foreign key column of the child table is defined and a delete cascade constraint is defined.

Random Solutions  
 
programming4us programming4us