I always drop all the triggers on a file, so the syntax I use is this:

DROP TRIGGER (file name) ALL ;

I forgot in my previous email that you have to end your command with a
semi-colon.

CREATE TRIGGER BEFORE_INSERT BEFORE INSERT ON (FILE NAME) FOR EACH ROW
CALLING "*(subroutine name)" ;

And what John Israel said makes sense - have your globally cataloged
trigger subroutine call a local subroutine - that way if you make
changes to your program, you don't have to re-globally catalog the
trigger subroutine. 


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 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

This e-mail (including any and all accompanying attachments) may
contain privileged and confidential information only meant to be
accessed and used by the intended recipient or the person(s)
authorized to access and deliver the intended recipient's e-mail.
This e-mail may contain information that is privileged or otherwise 
confidential. It should not be copied or forwarded to any 
unauthorized persons. If you received this e-mail in error, please 
delete it without copying or forwarding, and notify the sender by 
reply e-mail or by calling the MobilexUSA Privacy Office toll free at 
1-866-686-1717.
Thank you for your cooperation.
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to