SUBROUTINE KCL.UPDATELOGT(file.pointer,key)
This subroutine can be used to maintain the Kourier net change file associated with an application file which has a UniVerse trigger subroutine.
Before you can use this subroutine in an RDBMS trigger it must be cataloged in each account where users log in to your system or globally cataloged.
file.pointer | You must pass a file pointer to the Kourier net
change file
associated with the application file where a trigger has been added.
There are two techniques that can be used from UniBASIC to do this: OPEN or
OPENPATH. The OPEN method requires that each account where a users
logs into has a VOC pointer to the KT_CHGLOG file. The OPENPATH method
allows the KT_CHGLOG file to be opened by specifying its path without having
to create a VOC pointer in each account where users log into. The Kourier net change files are stored as subfiles under the file KT_CHGLOG. The name of net change subfile is usually the same name as the application file but it can be different. You can simply list the KT_CHGLOG file to see a list of net change file names. |
key | The item-id of the record to be written to the application file. |
file.pointer | Unchanged. |
key | Unchanged. |
If your trigger program updates other files (e.g. a trigger on ORDER.LINES updates the file ORDER) and you meet any of the following conditions:
AND you need to track net change on the updated file (e.g. ORDER), you will need to
In this example, the application file TERRITORY has an RDBMS trigger and we are using the OPEN keyword.
* * Add this code to the initialize section of your trigger * OPEN 'KT_CHGLOG,TERRITORY' TO FCL.TERRITORY THEN FCL.ISAOPEN = 1 ELSE FCL.ISAOPEN = 0 * * Add this code to your trigger just before you complete all trigger related work * IF FCL.ISAOPEN THEN CALL KCL.UPDATELOGT(FCL.TERRITORY,KEY)