NOACTION


What happens if you try to remove a row when there are referenced rows.
What happens can be defined when you create the table.


CREATE TABLE MyOrders 
(
ProductID INTEGER REFERENCES Products (ProductID) ON DELETE NO ACTION
)


On Delete No Action

This is the default
If the NO ACTION is used in a DELETE and there will be orphandes referenced rows then the delete will fail.
The ONDELETE NO ACTION is added after the REFERENCES clause of a create table command.




On Update No Action

When you try to update a row from the Products table that has referencing rows in the Orders table


CREATE TABLE 
(
ON UPDATE NO ACTION
)




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext