Kourier Integrator Online Help

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 that has a UniData or 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 for UniVerse Usage

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.

*
* MYFILE is the current filename.
*
* RECORD.ID is the current record ID.
*
* --------------------------------------------------------------------
* This part goes in the initialization section of the Trigger program
*
  CALL KCL.OPENLOG(MYFILE,F.KCLLOG,KCL.LOGFILENAME,KCL.ERR,KCL.PARAMS)
  KCL.ISOPEN = (KCL.ERR = '')
*
* End of initialization section
* --------------------------------------------------------------------
* This line goes at the end, just after all other trigger-related
* work is completed.
*
  IF KCL.ISOPEN THEN CALL KCL.UPDATELOGT(F.KCLLOG,RECORD.ID)
*
* End of final section
*

Related Topics: 

Kourier TCL Commands Overview

KCL.LISTLOG

KCL.ADDLOG