You can use SELECT FOR UPDATE
Main Topics
Browse All TopicsHi friends
I want to lock the table using the query in oracle so can any body tell how I will do the same I know how to lock the table in SQLServer as
begin transaction
update <table> set <field>=<value> where <condition>
This will lock the table. You can open another query analyzer window/session in sqlserver, and run a select * from <table>, it will block.
the same thing i want to do in oracle so can anybody tell me how I can do this in oracle
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I don't believe there is any way to get Oracle to do that. The approrpiate way to lock would be
lock table {table_name} in exclusive mode;
However, this will only prevent changes...a query against the table is still possible. Oracle ensures consistent reads, and doesn't prevent locks from giving you a consistent view to the data.
Business Accounts
Answer for Membership
by: HenkaPosted on 2005-04-15 at 02:49:50ID: 13789251
The Oracle locking mechanism is different from SQL Server one. You can read this documentation - the registration is free: e.com/docs /cd/B10501 _01/appdev .920/ a9659 0/adg08sql .htm#8123
http://download-west.oracl