Is there any possibility to reference to a field of a view to be sure about integrity?
Pseudocode example:
CREATE VIEW V_ONE AS SELECT .....
CREATE TABLE TWO ( ID INT REFERENCES V_ONE ( field ))
I don't want to CREATE TABLE T_ONE
instead of V_ONE
first to be able to reference T_ONE
.
@edit:
View V_ONE
collects data from multiple tables of an erp-system an preprocesses them. Table TWO
extends V_ONE
with some additional data, which should not be included into V_ONE
. There must not be an entry in table TWO
for every entry in V_ONE
, but I want to be sure there's no entry in table TWO
for which no base-data can be found in V_ONE
.