Length of numeric database columns is changed on export

Problem or error: Numeric database columns of length N are changed to length N+7 in the data dictionary file (.dct file).

Solution: When you export data and programatically create a data dictionary for the exported file, Unica Campaign adds additional space for numerics to handle scientific notation that may be needed to represent the numeric data.

For example, the data dictionary could add 7 to a numeric field of length 10 for the following scientific notation.

  • 1 - negative
  • 1 - decimal
  • 1 - e
  • 1 - plus or minus
  • 3 - exponents

If you know that exported numerics (magnitude and/or precision) do not exceed the maximum numeric value that can be represented using the defined width, you can use either of the following methods to control the length of exported numeric fields.

  • Create predefined data dictionary files with hard-coded lengths for numeric fields.

    Note that if the value exceeds the defined width, error 11335 occurs (Field width too small to hold source text data).

  • For numeric fields, create a derived field that converts the numeric column to a string with length of 10, then output that value. For example:

    FORMAT(NUM_COL, 10)

    If the value's width exceeds the FORMAT width specification of N, the leftmost N places are kept. The rest are truncated and discarded without an error.