× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Unable to Execute Trigger..?
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Fri, 17 Mar 2000 17:15:11 -0600 (CST)


It doesn't matter what language your trigger program is written in.

The errors that you list here seem to indicate that the program is being
called recursively.   This would imply that your trigger program is
actually UPDATING (or WRITING) to the same physical file that its
triggered from!
 
Think about it:

     Some program writes/updates a record.   
        -- therefore --
     The operating system fires off your trigger because a record
           was written/updated.
        -- then --
     The trigger updates a record.
        -- therefore --
     the operating system fires off your trigger because a record
           was written/updated.
        -- then --  
     the trigger updates a record
        -- therefore --
     the operating system fires off your trigger because a record
           was written/updated.

And so on, and so forth, forever!

Therefore, if you update/write from a trigger program, you MUST make sure
that whatever you do will not cause a further update to the same file.
Make sense?

If you want to make changes inside a trigger, make the changes to the
"AFTER" record buffer.  This will cause it to be written to the file by
the operating system.

Have fun.



On Fri, 17 Mar 2000, a b wrote:
> Hello everyone... !
> 
> I was wondering if someone could possibly point me in
> the right direction or tell me what it might be that
> I'm doing wrong.  I'm trying to execute an RPG program
> from a Physical File Trigger after and SQL insert is
> performed, but it continues to crash. Will a trigger
> ONLY call a CL program, or will it call an RPG?  
> 
> My attempt is to perform the following;  Insert a row
> into a physical file, execute an RPG program which
> then performs data population in other files.  
> 
> Any help would greatly be appreciated.  I've included
> the a couple of the errors which have displayed every
> time I attempt to update the triggered physical file.
> 
> Any help would greatly be appreciated.
> 
> Thanks
> AB
> --- ERRORS -----------------------------------------
>                         
>  Message . . . . :   An error in the trigger program
> was detected before WRITE  
>    on file EXXXXX1PX (C G D F).                       
>                         
>  Cause . . . . . :   RPG procedure EFXXX1R in program
> MISTEMP/EFXXXK1R       
>    detected an error in the trigger program before
> WRITE operation was done on  
>    file EFXXX1PX. The actual file is
> MISTEMP/EFDXXX1PX(EFXXXXR1P). The WRITE 
>    operation was not performed.                       
>                          
>                      
>  Message . . . . :   EFDXXX1R was called recursively. 
>                         
>  Cause . . . . . :   RPG procedure EFDXXXX1R in
> program MISTEMP/EXXXXK1R       
>    called itself or another procedure which then
> called procedure EXXXX1R.    
>  
> ----------------------------------------------------
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
> 
> 

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.