IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Trigger


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thisak

New User


Joined: 09 Jun 2006
Posts: 14

PostPosted: Wed Sep 04, 2013 3:38 pm
Reply with quote

I have a Table A and when a column update take place, then certain records from Table B should be deleted (i.e. using WHERE) and in Table C, a column should be updated. Can we do these kind of bulk deletion and bulk update using DB2 Trigger?
If possible, provide me sample or reference code.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Sep 04, 2013 3:47 pm
Reply with quote

Why do you need to handle them in Trigger and not in Application program itself??
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 04, 2013 7:13 pm
Reply with quote

Hello,

Sounds like the "trigger" is a solution looking for an opportunity . . .

As PB asks, why use a trigger?
Back to top
View user's profile Send private message
thisak

New User


Joined: 09 Jun 2006
Posts: 14

PostPosted: Tue Sep 10, 2013 5:03 pm
Reply with quote

I'm not sure when will update take place in Table A. There should some watchdog to monitor the table and trigger job. Not sure how can we do this?

Or thro CICS program, again I'm not sure whether a Transaction will start by DB update?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 10, 2013 6:52 pm
Reply with quote

Hello,

I believe this is being made more difficult than it needs to be . . .

In the code, when "something" happens, do everything in the code - no need to involve something else.

Possibly i misunderstand. If you explain in more detail, we may be able to offer more/other suggestions.
Back to top
View user's profile Send private message
thisak

New User


Joined: 09 Jun 2006
Posts: 14

PostPosted: Wed Sep 11, 2013 9:51 am
Reply with quote

Ok... let me add more detail to it.

There are 2 processes taking place, one is in Mainframe and other is in external system (Java environment). Everyday, we are not sure which process will complete first and each of it doesn't have fixed end time. But, once they both are completed, they can alert either sending MQ message OR by updating flags in DB2 table (say Table A).

Only when above said 2 processes are completed, subsequently deletion and updation should take place in Table B & C respectively.

Please see attachment as well.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 11, 2013 7:02 pm
Reply with quote

Hello,

I still see no need for a trigger . . .

Whatever determines that both are done should be able to do all of the work needed. What am i missing?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to define transaction that trigge... CICS 3
No new posts Trigger mainframe job , when file pla... All Other Mainframe Topics 2
No new posts trigger enter key automatically call ... CICS 17
No new posts Application not run by time HH:MM tri... IBM Tools 1
No new posts How to track incoming input files tha... JCL & VSAM 6
Search our Forums:

Back to Top