Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Adarshask
Starting Member
3 Posts |
Posted - 2009-10-26 : 02:46:27
|
Hi, 1) I want to know whether the SELECT FOR UPDATE can be used to lock the records in a table without using a cursor?DML:create table product( product_id number(4) not null, product_description varchar2(20) not null ); insert into product values (1,'Java');insert into product values (2,'Oracle');insert into product values (3,'C#');insert into product values (4,'Javascript');insert into product values (5,'Python');So i have a table full of data:Now i execute the statement below to lock the recordsSELECT * FROM PRODUCT FOR UPDATE OF PRODUCT_ID; So, on trying to update the PRODUCT_ID, an error should be raised, since the record would be locked. UPDATE PRODUCT SET PRODUCT_ID = 100 WHERE PRODUCT_ID = 1;But this update statement is getting executed without any problem? Am i missing anything?  |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
|
Adarshask
Starting Member
3 Posts |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-10-26 : 06:47:16
|
This is a forum for MS Sql Server.I think you can get a better help in a ORACLE forum. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|