Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to Lock and unlock a table until SP completes
You can lock a table
LOCK TABLE table IN ROW SHARE MODE
LOCK TABLE table IN ROW EXCLUSIVE MODE
LOCK TABLE table IN SHARE MODE
LOCK TABLE table IN SHARE ROW EXCLUSIVE MODE
LOCK TABLE table IN EXCLUSIVE MODE
After mode you can put an additional clause of NOWAIT depending upon your need, like
LOCK TABLE table IN EXCLUSIVE MODE NOWAIT
After you issue a commit on this table, the lock would be released.
Hope this helps.
With Warm Regards
Siddharth Haldankar
Cisco Systems Inc. ODC
Zensar Technologies Ltd.
# : 4128374
shaldank_at_cisco.com
s.haldankar_at_zensar.com
-----Original Message-----
rgaffuri_at_cox.net
Sent: Monday, August 04, 2003 5:35 PM
To: Multiple recipients of list ORACLE-L
Dear List:
How can I lock and then unlock a table? A SP only runs about 2 sec, but during its execution, sometimes there are more records saved to the table the SP is working on, then the SP confused. I want to be able to lock a table while the SP is executing, and then by the end, release the lock. Is there a way to do this? How? Can any one give me an example?
Thanks
Steven
Do you Yahoo!?
Yahoo! <http://us.rd.yahoo.com/evt=10469/*http:/sitebuilder.yahoo.com>
SiteBuilder - Free, easy-to-use web site design software
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Siddharth Haldankar
INET: shaldank_at_cisco.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Aug 04 2003 - 07:44:26 CDT
![]() |
![]() |