If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > URGENT!!! The WITH ROW MOVEMENT option for a VIEW

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-04, 10:45
kdima71 kdima71 is offline
Registered User
 
Join Date: Nov 2004
Posts: 23
Thumbs down URGENT!!! The WITH ROW MOVEMENT option for a VIEW

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.

Last edited by kdima71; 12-20-04 at 04:31.
Reply With Quote
  #2 (permalink)  
Old 12-18-04, 12:59
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Appears to be a bug ... Raise it as a PMR with IBM

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 12-20-04, 00:54
kdima71 kdima71 is offline
Registered User
 
Join Date: Nov 2004
Posts: 23
Hi all! I am sorry for my poor English.

The workaround of a problem, with which I have met, was successfully by me found!!!

Best regards, Dmitriy

Last edited by kdima71; 12-20-04 at 09:44.
Reply With Quote
  #4 (permalink)  
Old 12-20-04, 13:44
n_i n_i is online now
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Could you share it with us?

Thanks
Reply With Quote
  #5 (permalink)  
Old 12-21-04, 00:33
kdima71 kdima71 is offline
Registered User
 
Join Date: Nov 2004
Posts: 23
Hi all. I am sorry for my poor English.

The workaround consists that it is necessary forcedly to set
NEW TRANSITION VARIABLE = OLD TRANSITION VARIABLE,
If the new value for partition key does not fall outside the limits
allowable significances (CHECK CONSTRAINT) for partition.

For example:
Code:
CREATE TRIGGER NODE_1_B_UR 
NO CASCADE BEFORE UPDATE OF NODE_ID ON NODE_1 
REFERENCING  OLD AS old  NEW AS new  
FOR EACH ROW MODE DB2SQL 
BEGIN ATOMIC
 if old.node_id = new.node_id then
  set new.node_id = old.node_id;
end if;
END@
Best regards, Dmitriy.
Reply With Quote
  #6 (permalink)  
Old 12-21-04, 04:08
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
This does sound a good work-around ... IMHO, this is a very expensive way of doing this ...
Assuming you have a support contract with IBM, make it a point to report it and get it fixed, so that your system does not underperform

Cheers
sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 12-21-04, 04:56
kdima71 kdima71 is offline
Registered User
 
Join Date: Nov 2004
Posts: 23
Hi sathyaram! I am sorry for my poor English.

I with you completely agree. It most likely not "work-around", and "patch"

Infortunately, while my company does not have official support from IBM!

But I do not despond and I shall wait for...

Best regards, Dmitriy.
Reply With Quote
  #8 (permalink)  
Old 12-21-04, 04:58
kdima71 kdima71 is offline
Registered User
 
Join Date: Nov 2004
Posts: 23
Sorry, it just net. The repetitions are necessary for deleting.

Last edited by kdima71; 12-21-04 at 05:27.
Reply With Quote
  #9 (permalink)  
Old 12-21-04, 04:58
kdima71 kdima71 is offline
Registered User
 
Join Date: Nov 2004
Posts: 23
Hi sathyaram! I am sorry for my poor English.

I with you completely agree. It most likely not "work-around", and "patch"

Infortunately, while my company does not have official support from IBM!

But I do not despond and I shall wait for...

Best regards, Dmitriy.
Reply With Quote
  #10 (permalink)  
Old 01-22-05, 09:10
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Dimitriy .. Fixpak 8 for version 8 has a number of fixes for Union All views ... Your shop should upgrade

Based on the fix descriptions, I guess it is very critical for IBM DB2 V8 shops who are FP4+ and using UNION ALL Views to apply Fixpak 8 ... (hoping Fixpak 8 doesn't introduce new bugs )

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On