MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need suggestion on handling cursors in multiple tables

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
pappu47
Beginner


Joined: 10 Jan 2005
Posts: 12
Topics: 4
Location: Hyderabad

PostPosted: Tue Mar 04, 2008 9:32 pm    Post subject: Need suggestion on handling cursors in multiple tables Reply with quote

I Need to create a flat file when there is any change in history files and if the record have multiple changes in that records i have write all the records(before and after) in to output file.Each field in flat file has corresonding columns in one table.My requirement is to check the each history table and look any change in date field with current date.
if i have multiple changes in particular dates i have capture before and after changes as different records.

Example:

o/p file :

01 out-put-rec.
05 field1 pic x(01).
05 field2 pic x(02).
05 field3 pic x(01).


these fields are in different tables like field1 in Table1 ,field2 in Table2 and field3 in Table3.These fields will be loaded in database whenever any change in these fields either batch or online process.

All the above 3 tables have 3 history tables so my approach is to find change in history tables with key as date field.I am checking current date with date in the hist table field so if any change i am setting switch and finally i am checking all the switches and writing the records.
But if I have any multiple changes any history table i need to capture all the records with before and after changes.


can someone suggest best approach?

Thanks
Pappu
Back to top
View user's profile Send private message Yahoo Messenger
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Wed Mar 05, 2008 8:18 am    Post subject: Reply with quote

Instead of 3 history tables just use a change table with triggers on table1, 2, and 3 to insert an entry in the change table when there is a change to the table1, 2, or 3.
Or research the log file and see if you can get you data from that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group