473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Multiple condition trigger

1
I need help with a multiple condition trigger. I saw a post on Dec '06 and coded my trigger like that one but it still doesn't work. I am using DB2 V9 on z/OS.

CREATE TRIGGER DB2DBA.DSOPTCR5
NO CASCADE BEFORE INSERT ON MAD.DSOPTCT
REFERENCING NEW AS N
FOR EACH ROW MODE DB2SQL
SELECT CASE WHEN N.CNSTRNT_TO_TYPE_CD = 'C'
AND NOT EXISTS(SELECT 1
FROM MAD.DSCNCUT
WHERE MAD.DSCNCUT.CUST_GUID = N.TO_GUID)
THEN CAST(RAISE_ERROR(
'MI001',
'CUSTOMER IS NOT ON FILE')) AS INT
WHEN N.CNSTRNT_TO_TYPE_CD = 'H'
AND NOT EXISTS(SELECT 1
FROM MAD.DSCNHAT
WHERE MAD.DSCNHAT.CUST_GUID = N.TO_GUID)
RAISE_ERROR(
'MI001',
'HAULER IS NOT ON FILE');
WHEN N.CNSTRNT_TO_TYPE_CD = 'L'
AND NOT EXISTS(SELECT 1
FROM MAD.DSCNLDT
WHERE MAD.DSCNLDT.CUST_GUID = N.TO_GUID)
RAISE_ERROR(
'MI001',
'THE LOAD IS NOT ON FILE');
END
FROM SYSIBM.SYSDUMMY1;

Thank you for your help.
Feb 1 '10 #1
0 1937

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mary | last post by:
We are developing a DB2 V7 z/OS application which uses a "trigger" table containing numerous triggers - each of which is activated by an UPDATE to a different column of this "trigger" table. When...
5
by: zfeld | last post by:
I am serializing an object to XML and writing it to disk. whenever a change to my object occurs I call the save function to re-write to disk (see code below). I am monitoring the directory where...
2
by: Wei Wang | last post by:
Hi, Can I call multiple functions in one trigger? Something like this: CREATE TRIGGER match_cond_name_generate BEFORE INSERT OR UPDATE ON public.predicate_index FOR EACH ROW EXECUTE...
8
by: Najib Abi Fadel | last post by:
Hi all i am running PostgreSQL 7.3.2, i have a VIEW for which i implemented multiple RULES on UPDATE. The weird think is that the Update Query corresponding to one of the rules is updating...
11
by: UDBDBA | last post by:
Hi: This is a merge questions which has been posted and answered... in my case need more clairification when target table (tableB) matched multiple rows to be updated based on the ON condition...
0
by: Rob R. Ainscough | last post by:
I'm pretty frustrated right now, but I'm unable to get a Launch Condition to work at all in my Condition statement of a Registry entry. (working on a Deployment Project) 1. In Launch...
7
by: apattin | last post by:
Hi experts, I am having a hard time coding a trigger to handle multiple validation conditions in DB2 UDB V8.1.9.. I thought that a single trigger might be better than one-trigger-per-condition,...
9
by: Geneman | last post by:
I am using the current code to make a button visible. Private Sub Form_Current() If Me.related = "X" Then Me.addinfo.Visible = True Else Me.addinfo.Visible = False End If End Sub
3
by: Chirag | last post by:
I want to create a table with member id(primary key for Students,faculty and staff ) and now i want to create issues with foreign key as member id but in references i could not able to pass on...
7
by: Berryl Hesh | last post by:
I wouldn't nomally post this here, as it has something to do with the ListView control usage I think, or maybe with a race condition or some windoes messaging. I'm just not sure. The test below...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.