472,958 Members | 2,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1911

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
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.