Kourier Integrator Online Help
For complex exports, Kourier allows a programmer access to the various steps needed to create the information included in an export dataset. There are two ways that a programmer can interface with the Kourier export engine: Export Subroutines or Event Handlers. Both of these approaches offer similar capabilities. Using Event Handlers have the following (minor) advantages:
Export Subroutines have the following (minor) advantages:
For information on using Export Subroutines click here.
Event Handlers can be used to generate some or all of the information in the export dataset. The programmer has access to the following events.
|
@ID |
For U2 to SQL/File or REST Exports, this variable will contain the item-id of the record that is currently being processed in the DataSet Detail Event Handler. For all other Event Handlers this variable will contain and empty string. For ODBC to SQL/File or Flat-file Exports, this variable will always contain an empty string. |
||||||||||||||||||||||||||||||||||||||||||
@RECORD |
For U2 to SQL/File or REST Exports, this variable will contain the contents of the record that is currently being processed in the DataSet Detail Event Handler. For all other Event Handlers this variable will contain and empty string. For ODBC to SQL/File or Flat-file Exports, this variable will contain the contents of the row that is currently being processed in the DataSet Detail Event Handler. The data from each Source Column is copied into the attribute corresponding to the Line number of the field specified in the export. For all other Event Handlers this variable will contain and empty string. |
||||||||||||||||||||||||||||||||||||||||||
EXPORTFMT$ |
This read-only variable contains an encoded representation of the Export Format (e.g. TAB, XML, etc.) that was specified in the export. This variable must be passed to the subroutine KT.RMLIST so it can serialize the data into the requested format. The KT.RMLIST subroutine is most commonly used in the DataSet Detail Event Handler.FIELD$ |
||||||||||||||||||||||||||||||||||||||||||
ERR.NO$ |
This variable can be used to raise an exception and terminate the processing of the export. It should contain the item-id of a message in either the KUST-MESSAGES or KORE-MESSAGES file. Best practice would be to raise an exception it in either BeforeSelect or DataSet Init Event Handler. |
||||||||||||||||||||||||||||||||||||||||||
ERR.PARMS$ |
This variable may contain any parameters associated with the exception being raised in the ERR.NO$ variable. The list of parameters is multi-value delimited. |
||||||||||||||||||||||||||||||||||||||||||
FILENAME$ |
For U2 to SQL/File or REST Exports, this read-only variable will contain the primary Export Data File name as defined in the export. For REST exports, if the Export Data File name contains a substitution expression, this variable will contain the fully processed substitution expression (e.g. if the value of a parameter named Location is FLA and the Export Data File field contains the string {%Location_DEALS} this variable will contain the string FLA_DEALS). For ODBC to SQL/File or Flat-file Exports, this read-only variable will contain the Source Table name specified in the export. If the Source Table name contains a substitution expression, this variable will contain the fully processed substitution expression. |
||||||||||||||||||||||||||||||||||||||||||
OP$ |
In the DataSet Header, DataSet Detail and DataSet Footer Event Handlers, this variable is used to return the serialized data to include in the export dataset being built. For all other Event Handers, this variable will be ignored. |
||||||||||||||||||||||||||||||||||||||||||
SKIP$ |
In the DataSet Detail Event Handler, this variable can be set to indicate that the current record being processed should not be included in the dataset being built by the export. |
||||||||||||||||||||||||||||||||||||||||||
PROPS$ |
A dynamic array that contains run-time information for the export that can be useful to the programmer. Use the equated constants defined in the KORE-INCLUDES KEX.EQUATES include to reference the various fields in the PROPS$ variable. Following are the Extract/Set properties using the <KEX$XXX> variable syntax.
|
This Event Handler interface can be used from a Kourier export. To access information in the PROPS$ variable, use the equated constants as described in KORE-INCLUDES KEX.EQUATES.