Use Case Accelerators > How to Copy Information from a Header Record to Detail Records

How to Copy Information from a Header Record to Detail Records

Article #: Product: Version:

Summary

When data sources contain more than one type of record in a single file, the source records may occur in a "header-detail" order, where the association of each detail record is implied by the order; that is, each detail record is a "child" of the header record that appears above it.

It is often necessary to add the header record's key to each detail record. For example, if the detail records will be loaded into a relational database, the header records' keys may be used as foreign keys.

Adding the header-record keys (along with any other header-record information) to the detail records can be done in a DMExpress task using user-defined values.

Resolution

The attached example demonstrates how to add key values from header records to detail records. It takes a source file containing information about employees and their dependents, and adds each header record's key - the employee ID - to the detail records.

Attachments

65_Header_Details.zip, compatible with DMExpress version 7.4.3 or higher

Additional Information

Last updated: