Hi all! I am sorry for mine poor English.
I have DB2 UDB 8.2 for Win2000 (after FixPack 7).
I want at once to make the explanation,
I use an option WITH ROW MOVEMENT
with understanding for what purposes it serves.
I have made, following:
Code:
DROP TABLE NODE_1
CREATE TABLE NODE_1 (
DOC_ID INTEGER NOT NULL,
NODE_ID INTEGER NOT NULL,
CONSTRAINT NODE1_CHK
CHECK (NODE_ID = 1)
ENFORCED
ENABLE QUERY OPTIMIZATION
)
DROP TABLE NODE_2
CREATE TABLE NODE_2 (
DOC_ID INTEGER NOT NULL,
NODE_ID INTEGER NOT NULL,
CONSTRAINT NODE2_CHK
CHECK (NODE_ID = 2)
ENFORCED
ENABLE QUERY OPTIMIZATION
)
DROP VIEW ALL_NODES_V
CREATE VIEW ALL_NODES_V AS
SELECT * FROM NODE_1
UNION ALL
SELECT * FROM NODE_2
WITH ROW MOVEMENT
Further:
Code:
INSERT INTO ALL_NODES_V VALUES (1,1)
COMMIT
SELECT * FROM ALL_NODES_V
DOC_ID NODE_ID
----------- -----------
1 1
1 records are selected.
UPDATE ALL_NODES_V SET NODE_ID = 1
COMMIT
SELECT * FROM ALL_NODES_V
DOC_ID NODE_ID
----------- -----------
1 1
1 1
2 records are selected.
It how to understand?
Why DB2 adds a new record the ambassador UPDATE???
Someone collided with such problem and whether there is any workaround?And generally it a "BUG" or "QUIRKS IN SQL" (on Graeme Birchall)?
Beforehand I thank for any explanations and excuse
for a possible categoriality!
Best regards, Dmitriy.