Types of cursor locks and explanation each of them ?
Answer Posted / kalyan dhara
FOR UPDATE and CURRENT OF
---------------
When you issue a SELECT...FOR UPDATE statement, the RDBMS
automatically obtains exclusive row-level locks on all the
rows identified by the SELECT statement, holding the records
“for your changes only” as you move through the rows
retrieved by the cursor. No one else will be able to change
any of these records until you perform a ROLLBACK or a COMMIT.
CURSOR toys_cur IS
SELECT name, manufacturer, preference_level,
sell_at_yardsale_flag
FROM my_sons_collection
WHERE hours_used = 0
FOR UPDATE;
UPDATE table_name
SET set_clause
WHERE CURRENT OF toys_cur ;
OR
DELETE FROM table_name
WHERE CURRENT OF toys_cur ;
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How do I clear the screen in sql plus?
What is difference between hql and native sql?
What is the difference between a subquery and a join?
how to fetch alternate records from a table? : Sql dba
What is the difference between subquery and correlated query?
What is left join in sql?
How many clustered indexes can you have?
What are views in sql?
What are tables and fields?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
How do I view stored procedures?
What is a string data type in sql?
how many ways to get the current time? : Sql dba
What does 0 mean in sql?
what is sql? : Sql dba