?
Solved

Datarow lock in Oracle

Posted on 2004-10-16
3
Medium Priority
?
1,410 Views
Last Modified: 2012-05-05
Hello,
I would like to create a table with datarows as the default lock, how am I about to do it?
To be more specific, in Sybase I know something like the following

create table myTable (xxxxx) lock datarows
# as I understand, this sql statement will create a table with datarows locking is the chosen locking protocol.

The question is: can I have something similar to that in Oracle? What is the SQL statement?
Thanks,
Do
0
Comment
Question by:dttai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:sapnam
ID: 12331691
As far as I know, there is no need to specify anything while creating the table.  Locking concepts change from database to database.  In Oracle, the locking is done by Oracle as needed.  In case you want to specifically lock a record, you can do that by using SELECT FOR UPDATE statements
0
 
LVL 23

Accepted Solution

by:
seazodiac earned 2000 total points
ID: 12333387
dttai:

THere is no such thing in oracle, to your amazement, this is what Oracle is heads and shoulders above other RDBMS including sybase.

the default locking is the row-level locking in oracle.

but there are RS, RSX and X (exclusive) locking on the row level.
and there are the same on the table level.

but Oracle usually take care of this for you during your transaction, yes, transparent to users and developers.

all you need to do is read the manual and understand how oracle does this differently from other dbs.
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 12338333
Do not assume that Oracle does things the same way that SQL Server does.  In addition to the differences with record-locking (which Oracle does much better than SQL Server), some other things that are significantly different between SQL Server and Oracle are:
1. how nulls are handled and/or referenced
2. how dates are handled (Oracle dates can include the time)
3. "autonumber" columns - Oracle does not support them directly, but uses a sequence plus a trigger
4. whether stored procedures return result sets (arrays) or not

I wouldn't say that either the SQL Server way or the Oracle way is "better" or "worse"  for any of these, but be aware that they are different between the two systems, and if you are used to the way they work in SQL Server, you will have to learn some new ways of working with them in Oracle.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question