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 are the different types of database management systems?

523


What is interval partition?

537


How to download oracle sql developer?

650


Why is there a need for sqlcode and sqlerrm variables?

581


What is sql procedures and functions?

523






how can we optimize or increase the speed of a mysql select query? : Sql dba

501


What is tuple in sql?

538


What is Histogram?

1095


how many sql dml commands are supported by 'mysql'? : Sql dba

563


How do you update sql?

516


What will you get by the cursor attribute sql%rowcount?

545


how to convert numeric values to character strings? : Sql dba

564


what is rdbms? : Sql dba

571


Which language is used in sql?

514


Which data type is a composite type?

519