KCL.UPDATELOGT

Declaration

SUBROUTINE KCL.UPDATELOGT(file.pointer,key)

Description

This subroutine can be used to maintain the Kourier net change file associated with an application file which has a UniVerse trigger subroutine.

Compiling and Cataloging the 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.

Input Interface

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.

Output Interface

file.pointer Unchanged.
key Unchanged.

Caution

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:

  1. You are running on a Kourier release before 3.1.n
  2. You are running on a UniVerse release prior to 11.1.4

AND you need to track net change on the updated file (e.g. ORDER), you will need to

  1. Remove net change from the updated file from the Kourier GUI
  2. Add a trigger that call this routine.
  3. Add net change for the updated file from the Kourier GUI

Example

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)

See Also

Kourier Service Commands

Kourier Command Keywords

Kourier TCL Commands

 

User Guide - Table of Contents