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



Hi Gio,

I remember reading a post some time back about how to retrieve the name of
the program that updated/inserted/deleted the record that fired the
trigger.

I would presume if you knew the name of the program was NOT the trigger
program that you could ascertain what to do in the trigger program if I am
understanding your question.

It may also help if you could provide more information why updating one
record in the file would require updates to other record(s) in the same
file. (I remember doing things like this a hundred years ago to maintain
RRN chains )

Cheers






From: "Alan Shore via RPG400-L" <rpg400-l@xxxxxxxxxxxxxxxxxx>
To: "RPG programming on IBM i" <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: "Alan Shore" <ashore@xxxxxxxx>, "gio.cot" <gio.cot@xxxxxxxxxxx>
Date: 13/08/2020 07:51 PM
Subject: RE: [EXTERNAL] Trigger and recursion problem
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>



Hi Gio
Unless someone says something different, I believe you HAVE to let this
happen
A Trigger program captures what is being changed on the data
The suggestions of using a certain language to bypass the trigger makes no
sense
You are capturing the data change
It shouldn’t matter what is used to make that data change
Anyway, you say that one particular change could "trigger" a change to a
different record on the same file
This should eventually end
If it doesn’t, then the logic that links an update to another record is
faulty (in my opinion)

For example
A change to record 1, triggers a change to record 2
A change to record 2, triggers a change to record 3
A change to record 3, triggers a change to record 4
A change to record 4, triggers a change to record 5
The fault will be if a change to record 5 triggers a change to records 1,
2, 3 or 4
Then the perpetual loop continues
If this IS in fact what needs to happen, I would be asking why?
The jumps HAVE to end sometime

I CAN see that if the jumps are in fact limited, the trigger program could
bog down the system because so may jumps are being created

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
‘If you're going through hell, keep going.’
Winston Churchill


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
gio.cot via RPG400-L
Sent: Thursday, August 13, 2020 5:31 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Cc: gio.cot <gio.cot@xxxxxxxxxxx>
Subject: [EXTERNAL] Trigger and recursion problem

Hi all

I have this situation:

in the item master data file, i have a trigger ; now i would need add in
the trigger program a change, that in some situation do some update to
another record always in the item master data file , which however fire
again the trigger causing recursive error. How could menage this situation
(trigger that updates another record of the same file that has fired the
trigger) ?

i have read several post (some one say to use C, other says that i can use
CLP or also Ile with procedure.. and i'm very confused) in this moment i
have a master/mediator trigger program that call one o more program
(reading a file where i have strored the programs to call) that receive
this two parameters



DbTrgDs

DbTrgLen



DbTrgDS DS

DbFil Like( StdNam )

DbLib Like( StdNam )

DbMbr Like( StdNam )

DbTrgAct Like( StdChr )

DbTrgTim Like( StdChr )

DbCmtLck Like( StdChr )

DbReserve1 3

DbCcsId Like( StdBin4)

DbReserve2 8

DbBfrOfs Like( StdBin4)

DbBfrLen Like( StdBin4)

DbBfrNulOf Like( StdBin4)

DbBfrNulLn Like( StdBin4)

DbAftOfs Like( StdBin4)

DbAftLen Like( StdBin4)

DbAftNulOf Like( StdBin4)

DbAftNulLn Like( StdBin4)

DbTrgBuf 1 32767A

DbTrgAry 1A OverLay( DbTrgBuf )

Dim( %Size ( DbTrgBuf ))



DbTrgAry 1 32767 Dim( 32767 )



DbTrgLen S Like( StdBin4 )



Any idea or suggestion ? (P.S. i'm running on V7R2)



Thanks in advance

Gio





--
Questa e-mail è stata controllata per individuare virus con Avast
antivirus.
https://www.avast.com/antivirus
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.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.