Re: [U2] which files have triggers
November/December 2007. www.intl-spectrum.com/mag/NOVDEC.2007/default.aspx Regards, Clif On Jul 13, 2009, at 12:23 PM, Brian Leach wrote: Hi George I wrote about this in one of the back issues of Spectrum (you can download these from www.intl-spectrum.com). -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 13 July 2009 19:51 To: U2 Users List Subject: [U2] which files have triggers Is there a way to list which tables have active triggers? I know about LIST.SICA tablename, but if I make a change to the trigger program, and I need to DROP the trigger from all the TABLES usings it, how would I find out all the TABLES that are using that trigger? ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
[U2] which files have triggers
Is there a way to list which tables have active triggers? I know about LIST.SICA tablename, but if I make a change to the trigger program, and I need to DROP the trigger from all the TABLES usings it, how would I find out all the TABLES that are using that trigger? Is there an easier way to DROP/CREATE when modifying a trigger, if say the trigger is being used on 40 or 50 TABLES? For now I'll create a PAragraph that does the CREATEing and one that does the DROPing, and just add to each time a new TABLE is added to that trigger, then it would just be a matter of running the one PAragraph to drop, recompile, then other PAragraph to CREATE. George George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] which files have triggers
Hi George I wrote about this in one of the back issues of Spectrum (you can download these from www.intl-spectrum.com). I use a master trigger that reads a list of sub-triggers based on the file name. Okay it's an extra read, but it's worth it: the list of sub-triggers (which have the same calling arguments) are all called using regular Call @ syntax; and it allows you to swap in and out sub-triggers without having to drop the main trigger, log everyone off, and recreate it. Since I first wrote that for a 24x7x365 site, that wasn't an option. Also, because UniVerse caches subroutines in memory, it means that when you recompile any changes you want to change the name e.g. MySubTrigger.1, MySubTrigger.2 and so forth. Then change the name in the sub-trigger list(s) when you are sure you've tested it. Brian -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 13 July 2009 19:51 To: U2 Users List Subject: [U2] which files have triggers Is there a way to list which tables have active triggers? I know about LIST.SICA tablename, but if I make a change to the trigger program, and I need to DROP the trigger from all the TABLES usings it, how would I find out all the TABLES that are using that trigger? Is there an easier way to DROP/CREATE when modifying a trigger, if say the trigger is being used on 40 or 50 TABLES? For now I'll create a PAragraph that does the CREATEing and one that does the DROPing, and just add to each time a new TABLE is added to that trigger, then it would just be a matter of running the one PAragraph to drop, recompile, then other PAragraph to CREATE. George George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] which files have triggers
Thanks, I found the article. That would make tracking triggers easier. One thing however, in the routine, you have notriggers = dcount(triggers,@fm) for trigno = 1 to notriggers trigger = triggers(trigno) call @trigger(...,newid,newrec,oldid,oldrec,...) next trigno Just curious, since with this routine, you effectively can have a trigger run as many triggers as needed, but, what I see as a problem, is if the 2nd trigger routine modifies NewREC, it will overwrite any modifications that the first trigger may have made to NewREC (assuming a BEFORE trigger). I guess you could assign a temp varible to oldrec, then for each iteration make oldrec = newrec, but then each successive trigger wouldn't have the original data to go by. George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Brian Leach Sent: Monday, July 13, 2009 3:24 PM To: 'U2 Users List' Subject: Re: [U2] which files have triggers Hi George I wrote about this in one of the back issues of Spectrum (you can download these from www.intl-spectrum.com). I use a master trigger that reads a list of sub-triggers based on the file name. Okay it's an extra read, but it's worth it: the list of sub- triggers (which have the same calling arguments) are all called using regular Call @ syntax; and it allows you to swap in and out sub-triggers without having to drop the main trigger, log everyone off, and recreate it. Since I first wrote that for a 24x7x365 site, that wasn't an option. Also, because UniVerse caches subroutines in memory, it means that when you recompile any changes you want to change the name e.g. MySubTrigger.1, MySubTrigger.2 and so forth. Then change the name in the sub-trigger list(s) when you are sure you've tested it. Brian ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] which files have triggers
All this talk about triggers and I just received the following from IBM. 7. UniVerse: Flashes Using fixtool to repair UniVerse dynamic file header corruption may result in data loss at 10.3.0 http://www.ibm.com/support/docview.wss?uid=swg21376672myns=swgimgmtmynp=OC SSCRY4mync=E At UniVerse 10.3, modifications made to the new.record contents in a trigger subroutine are not applied when the WRITE completes. http://www.ibm.com/support/docview.wss?uid=swg21392473myns=swgimgmtmynp=OC SSCRY4mync=E Jerry Banker -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Monday, July 13, 2009 3:43 PM To: U2 Users List Subject: Re: [U2] which files have triggers Thanks, I found the article. That would make tracking triggers easier. One thing however, in the routine, you have notriggers = dcount(triggers,@fm) for trigno = 1 to notriggers trigger = triggers(trigno) call @trigger(...,newid,newrec,oldid,oldrec,...) next trigno Just curious, since with this routine, you effectively can have a trigger run as many triggers as needed, but, what I see as a problem, is if the 2nd trigger routine modifies NewREC, it will overwrite any modifications that the first trigger may have made to NewREC (assuming a BEFORE trigger). I guess you could assign a temp varible to oldrec, then for each iteration make oldrec = newrec, but then each successive trigger wouldn't have the original data to go by. George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Brian Leach Sent: Monday, July 13, 2009 3:24 PM To: 'U2 Users List' Subject: Re: [U2] which files have triggers Hi George I wrote about this in one of the back issues of Spectrum (you can download these from www.intl-spectrum.com). I use a master trigger that reads a list of sub-triggers based on the file name. Okay it's an extra read, but it's worth it: the list of sub- triggers (which have the same calling arguments) are all called using regular Call @ syntax; and it allows you to swap in and out sub-triggers without having to drop the main trigger, log everyone off, and recreate it. Since I first wrote that for a 24x7x365 site, that wasn't an option. Also, because UniVerse caches subroutines in memory, it means that when you recompile any changes you want to change the name e.g. MySubTrigger.1, MySubTrigger.2 and so forth. Then change the name in the sub-trigger list(s) when you are sure you've tested it. Brian ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] which files have triggers
-Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of jpb-u2ug Sent: Monday, July 13, 2009 5:34 PM To: 'U2 Users List' Subject: Re: [U2] which files have triggers All this talk about triggers and I just received the following from IBM. At UniVerse 10.3, modifications made to the new.record contents in a trigger subroutine are not applied when the WRITE completes. Now THAT'S a problem! Jerry Banker ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users