General information
Category:
Coding, syntax & commands
>What happens if I try to delete many records and the database engine discovers, while deleting, that a record is locked by a user? For example, a table contains many thousands of records and 1000 of them meet a certain condition. I want to delete those records so I issue the command DELETE FOR that condition. After having deleted 800 of those 1000 records, the database engine encounters a record that is locked by a user. Does it automatically RECALL the 800 deleted records or do they remain deleted even though the command could not be completed successfully?
AFAIK, DELETE for many records locks entire table. So, it will attempt to lock the table first, and if at least one record locked by another user, it will fail to continue.
DELETE - SQL works differently. It locks current record only. So in case you are trying to /delete from table where.../, it will delete records until meet the record locked by another user and then failed to continue.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only