Hello, php gurus.
Need to lock tables in my web application not tor the time
the script run, but for the time the session lasts or the user
unlocks it in the next script.
Any ideas?
Thank you.
Oracle LOCK TEBLE for the session time?
Moderator: General Moderators
Linux RedHat 7.3
My Oracle is 8.17 and runs on Linux RedHat 7.3
Thank you
Thank you
There's an oracle SQL command called LOCK TABLE.
You can find it in the oracle sql reference book.
(pdf or on-line).
You can write a stored procedure that does it (for example through native dynamic SQL), and then call it from PHP.
For example:
Obviously the table must be yours or you need the "lock any table" system privilege.
I hope this helps.
Kamal
You can find it in the oracle sql reference book.
(pdf or on-line).
You can write a stored procedure that does it (for example through native dynamic SQL), and then call it from PHP.
For example:
Code: Select all
CREATE PROCEDURE lock_table (
table_name VARCHAR2,
lock_mode VARCHAR2,
no_wait BOOLEAN DEFAULT false)
IS
v_no_wait CHAR(6) := NULL;
BEGIN
IF no_wait THEN v_no_wait := 'NOWAIT';
END IF;
EXECUTE IMMEDIATE 'LOCK TABLE ' || table_name || ' IN ' ||
lock_mode || ' MODE ' || v_no_wait;
END lock_table;I hope this helps.
Kamal
Last edited by kamal on Fri Sep 13, 2002 6:06 am, edited 2 times in total.