While the trigger needs to be globally cataloged, it can call a locally 
cataloged routine. Every trigger we have simply calls a 2nd locally cataloged 
program that does all the work.  Without this, it makes testing very difficult 
between a system that has live/test accounts on the same box.


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 Jeff Schasny
Sent: Friday, July 30, 2010 1:12 PM
To: U2 Users List
Subject: Re: [U2] Universe Triggers

Thank You.

Now I need to drop the trigger and re create it. What is the drop 
trigger syntax? Is all this actually documented somewhere?

Barry Rutherford wrote:
> Your subroutine has to be globally cataloged - nothing else will work.
>
> The syntax of the create trigger that works for me is this:
>
> CREATE TRIGGER BEFORE_INSERT BEFORE INSERT ON (FILE NAME) FOR EACH ROW
> CALLING "*(subroutine name)"
>
> BEFORE_INSERT - name I gave my trigger - can be anything you want
> (FILE NAME) - File trigger is attached to
> *(subroutine name) - globally cataloged subroutine that you want called
>
> Your sample subroutine below has 15 passed-in parameters and my programs
> only have 14 - I think you repeated the last one twice.
>
> Do I need to open the file to the SQLTRIG variable in the program?  - No
> Do I need to open the dictionary to SCHEMA? - No
>
> Barry Rutherford
> Programmer / Analyst
> MobilexUSA
> 930 Ridgebrook Rd, 3rd Floor
> Sparks, MD 21152
> Local: 443-662-4101 x 6162
> Toll Free: 800-786-8015 x 6162
> Fax: 443-662-4225
> http://www.mobilexusa.com
>  
>
> -----Original Message-----
> From: u2-users-boun...@listserver.u2ug.org
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jeff Schasny
> Sent: Friday, July 30, 2010 11:47 AM
> To: U2-Users@listserver.u2ug.org
> Subject: [U2] Universe Triggers
>
> AIX 5.3 UV 10.2Universe
>
> I want to put a trigger on a file to send an email message then a new 
> item is written. I have read the (very non-helpful) section on triggers 
> in the Universe System Description documentation but I'm still a bit 
> confused. I have a program (subroutine) written with the arguments as 
> established in the manual:
>
> 0001:  SUBROUTINE 
> NEW_TRANSFER(SQLTRIG,SCHEMA,TABLE,EVENT,TIME,NEWID,NEWREC,OLD
>  ID,OLDREC,ASSOC,ASSOC.EVENT,COUNT,CHAIN,CASCADE,CASCADE)
>
> Do I need to open the file to the SQLTRIG variable in the program?
> Do I need to open the dictionary to SCHEMA?
>
>
> I'm assuming that trigger_name below should be the catalog name of the 
> program"
>
>
> CREATE TRIGGER trigger_name [BEFORE | AFTER] INSERT
>
> Can someone provide a concise series of steps I need to take to set this
> up?
>
>   

-- 
------------------------------------------------------------------------
Jeff Schasny - Denver, Co, USA
jschasny at gmail dot 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

Reply via email to