The onpload conversion process

The onpload conversion process is identical for both import or export operations.

The onpload utility:
  • Extracts the source data from their native format.
  • Examines the map.
  • Applies the conversions called out in the map.

    Conversion order is implied by the ordering of the source-field names that are specified in the map.

  • Calls any custom-conversion function that is specified for a source field.
    The parameters that onpload passes to the conversion function depends on the value of the HPLAPIVERSION parameter in the plconfig file:
    • If HPLAPIVERSION is set to 0 or it is not present in the plconfig file, then onpload passes the buffer into which the output should be placed, the maximum length of the output buffer, and the value of the input field.
    • If HPLAPIVERSION is set to 1, then onpload passes the buffer into which the output should be placed, the maximum length of the output buffer, the value of the input field, and the length of the input value.

    For more information, see The HPLAPIVERSION configuration parameter.

  • If there is a custom-conversion function, applies the value that the custom-conversion function places in the function output buffer to the destination field that is associated with the source field in the map.
  • Sends the results to the output generators.

The custom-conversion function API uses ASCII strings as the canonical data type. The API functions present data as ASCII strings and expect data from the custom-conversion functions to be presented as ASCII strings. The API functions convert source data of different types to ASCII strings, and also convert ASCII string data from custom-conversion functions to destination data types.