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


Please Help Members By Posting Answers For Below Questions

What is sqlite format?

813


How many joins can you have in sql?

687


What are the benefits of pl/sql packages?

736


How many tables can you join in sql?

707


Define select, insert, create, delete, update, drop keywords

776






Can there be 2 primary keys in a table?

725


What is execution plan in sql?

760


Can a varchar be a primary key?

697


Are stored procedures faster than dynamic sql?

738


What are all the different normalization?

744


What are literals in sql server?

738


How many types of tables are there?

692


Is progress software supports to ( pl/sql )?

717


Why do we use sqlite?

707


What is the difference between a query and a report?

680