I agree!  Triggers must be globally cataloged, but they can CALL a 
locally/directly cataloged subroutine that does all the real work.

Also remember to CLOSE your files in the trigger program or you might hit a max 
file limit (this might not be an issue if the OPENs are done in the 2nd 
subroutine, but they will burn you for sure if they are in the parent 
subroutine).


John Israel
Senior Programmer/Analyst
Dayton Superior Corporation
1125 Byers Road
Miamisburg, OH  45342


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett
Sent: Tuesday, June 14, 2011 12:02 PM
To: U2 Users List
Subject: Re: [U2] UniData Triggers

Shaun:

Remember, when you start going down the "trigger" path in UD, you may 
want to simply create two globally cataloged routines:

U2.MASTER.TRIGGER.D
U2.MASTER.TRIGGER.U

...or something like this.  These two triggers simply "call" defined 
subroutines.  We use a TRIGGER.CONF file like:

001 FileName@VMFileName@VMFileName...
002 UpdSubroutine@SVMUpdSubroutine@VMUpdSubroutine@VMUpdSubroutine...
003 DelSubroutine@SVMDelSubroutine@VMDelSubroutine@VMDelSubroutine...

...where field# 2 is used by the "update" trigger and field# 3 is used 
by the "delete" trigger.  With a structure like this you'll be able to 
insert and remove subroutines into triggers (after you create the 
trigger), and use "local" subroutines.  Plus none of the trigger 
programs, except the two master trigger programs, will need to be 
globally cataloged.

HTH,

Bill

------------------------------------------------------------------------
----- Original Message -----
*From:* <shaun.fergu...@ferguson.com
*To:* u2-users@listserver.u2ug.org
*Date:* 6/14/2011 7:54 AM
*Subject:* [U2] UniData Triggers
> We are creating a trigger on a file that is used extensively in the
> system.  Is it necessary to logoff users when creating an update trigger
> on a file or does UniData handle that when updating
> the trigger information to the header of the file?  The 'help' does not
> specify whether trigger creation requires exclusive access to the file
> or not.
>
> Thanks!
>
> Shaun Ferguson
> Applications Architect I
> Wolseley Group Services - 12500 Jefferson Avenue - Newport News - VA -
> 23602-4314
> T: (757) 989-2916 - F: (757) 989-2801 - E: shaun.fergu...@wolseley.com
> www.wolseley.com<blocked::http://www.wolseley.com/>
> Wolseley plc registered office Parkview 1220 Arlington Business Park
> Theale Nr Reading RG7 4GA United Kingdom
> Registration No. 29846 England
>
>
> _______________________________________________
> 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

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to