Allowed to have V9 Trigger using XMLPARSE?

steve mallett

Allowed to have V9 Trigger using XMLPARSE?
Hey, my first V9 question

Our developers are trying to create a trigger similar to below in DB2V9 for
Z/OS 1.9 and getting -873 SQLCODE 53090

Can't find anything specifically forbidding this but mention is made to declare
the XML doc as a :HV in other situations (which can't be done in trigger of
course) .
Is this syntax allowable?

CREATE TRIGGER TRIG
INSTEAD OF UPDATE ON T2
REFERENCING NEW AS
N
OLD AS O
FOR EACH ROW MODE
DB2SQL
BEGIN ATOMIC
UPDATE T3 MP
SET MP.DOC = XMLPARSE(DOCUMENT
N.DOC)
WHERE MP.ID = O.ID
AND MP.Col1 = O.Col1;
INSERT INTO T4 (
ID
, Col1
, COL2)
, DOC)
VALUES(O.ID
, O.Col1
, 'doc'
, XMLPARSE(DOCUMENT O.DOC)

_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.idug.org/db2-content/index.html has THOUSANDS of free technical presentations!
DB2 LUW, DB2 z/OS, Performance, Installation, Tuning, Coding, BI, Warehouses, - among
many more categories of help waiting for you!
Whether you are an old hand or a DB2 newbie, we have presentations for every level.
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Paul Bartak

Re: Allowed to have V9 Trigger using XMLPARSE?
(in response to steve mallett)
Check out this posting on the DeveloperWorks Exchange site:
http://www.ibm.com/developerworks/exchange/dw_entryView.jspa?
externalID=711&categoryID=52

This sample uses a trigger (with XMLPARSE) for an XML column. You
likely can modify it to meet your requirements.

_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L