PopulateData

Syntax

PopulateData (mapName, domainName, tempRecName, recName, instance)

Description

You can use the XREF populate data function to generate and execute set-based SQL to populate cross-reference data from a specified source record (table or view). This function provides an abstraction layer from the physical data persistence layer of the XREF framework, and is expected to be used for processing large volumes of data.

The following steps are generated and executed in this function:

  1. All data is removed from the temp table for the specified process instance.

  2. Existing XREF data for the specified domain is extracted to the temp table with the import flag set to N.

    Note:

    Element values are mapped to fields in the record based on map element order (not on name).

  3. Distinct rows of stage data are inserted into the temp table if they do not already exist, with the update flag set to Y.

    Note:

    Fields are mapped from temp to stage based on matching field names.

  4. GUIDs are generated on the temp table where they are blank.

  5. XREF data is inserted from the temp table where the import flag set to Y.

  6. The stage data is updated with GUIDs from the temp table.

The temp table has the following design constraints:

  1. The first column will be PROCESS_INSTANCE.

  2. The second column will be used for UniqueGUID (EOTF_COMMONELEMENT).

  3. The third column must be EOTF_IMPORT_FLG (for internal use by this function).

  4. The remaining columns correspond to the elements in the specified domain.

  5. The temp table column names do not have to match the element names in the maps.

  6. The temp table column names must match the corresponding fields on the stage table.

  7. The temp table should be keyed by ProcessInstance, UniqueGUID allowing for duplicates (blanks).

  8. There may be a performance benefit from having an index on the elements of each specified domain.

Note:

This function does not validate any of the data, therefore, users should be sure the data being populated does not violate any of the constraints defined in the value map definition. If the data rules are violated, future usability of the map may be impacted. This function is not responsible for protecting against the potential for truncation of existing data values caused by defining temp table fields shorter than the existing data values. If this occurs, no error will then be thrown, but existing values will not be matched properly to stage values, potentially resulting in unintended data redundancy.

Parameters

Parameter Description

mapName

The name of a dynamic (cross reference) value map, as string.

domainName

The name of the value map domain to populate data for, as string.

tempRecName

The name of the temp table to extract existing XREF data to, as string.

recName

The name of the stage record to populate data from, as string.

instance

The number to use when qualifying process instance, as integer.

Returns

Boolean indicating success or failure of the process.

Example

Local EOTF_CORE:Xref:Functions &xref = create EOTF_CORE:Xref:Functions();
Local string &mapName = "VendorIDs";
Local string &domainName = "PS";
Local string &tempRecName = Record.HR_VENDOR_TAO;
Local string &recName = Record.HR_VENDOR_STG;
Local boolean &success =
&xref.PopulateData(&mapName, &domainName, &tempRecName, &recName, &instance);