Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Trigger

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: DB2 Trigger
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

Moderator


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

PostPosted: Wed Sep 04, 2013 3:47 pm    Post subject:
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

Site Director


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

PostPosted: Wed Sep 04, 2013 7:13 pm    Post subject:
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    Post subject: Reply to: DB2 Trigger
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

Site Director


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

PostPosted: Tue Sep 10, 2013 6:52 pm    Post subject:
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    Post subject: Reply to: DB2 Trigger
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

Site Director


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

PostPosted: Wed Sep 11, 2013 7:02 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to track incoming input files tha... shreya19 JCL & VSAM 6 Thu Feb 25, 2016 6:15 pm
No new posts Issue in trigger vickey_dw DB2 3 Wed Feb 10, 2016 5:41 pm
No new posts Trigger a mainframe job by mail Praveen Thenraj IBM Tools 8 Wed Jan 13, 2016 12:05 pm
No new posts Setting up a new trigger krisprems DB2 4 Thu Dec 24, 2015 10:33 pm
No new posts Can a DB2 insert trigger execution of... TS70363 DB2 6 Tue Nov 24, 2015 10:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us