Book a mock interview and get instant feedback - Learn More
I need my table to lock until certain internal procedures involving table construction are finished.
lock_table is session specific and once session is closed lock will also be released and other users will be able to perform DMLs.
Making the table read-only before using the DDL commands (ALTER table) and making it read-write if the DDLs are successful would be preferable (even session is closed)
BEGIN execute immediate 'alter table table_name read only';
--Perform Your DDL Commands here.execute immediate 'alter table table_name read write';
Note that users can still choose data from tables despite this.