Is there a mechanism for soft deletion at the database level

Is there a mechanism for soft deletion at the database level in MySQLand Oracle, Such that: -

1) All deleted requests delete data

2) All sample requests do not retrieve soft deletion data without any explicit conditions where filtering of deleted data is performed.

3) All update requests only work for data that has not been softly deleted.

+4
source share
2 answers

Oracle has a component called Workspace Manager that can do all this plumbing.

https://docs.oracle.com/database/121/ADWSM/long_intro.htm#ADWSM010

" (), INSTEAD OF , . , , INSTEAD OF . , , , .

, . - (, - , . - ...).

+3

MySQL, Oracle.

view, . SELECT SELECT, .

, .

CREATE VIEW my_active_stuff AS 
SELECT *
where deleted is null
FROM my_stuff_table;

. .

SELECT *
FROM my_active_stuff
WHERE ...

MySQL.

+1

Source: https://habr.com/ru/post/1695188/


All Articles