Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-8898

EXPORT (XML template) does not infer decimal type correctly when number of decimal places are specified

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.0
    • None
    • None

    Description

      #EXPORT does not generate the type correctly for decimal types when the number of decimal places is specified. I suspect this is due to the fact that the code looks for the last non-digit character in the string literal (ecltype) for the type and truncates to that point. Instead, it should be looking for the first digit in the string literal.

      Consider this example:

      decimalRec := RECORD
      DECIMAL3 A;
      DECIMAL3_1 B;
      END;
      LOADXML('<xml/>'); //"dummy" just to open an XML scope
      #DECLARE(out);
      #EXPORT(out, decimalRec);
      OUTPUT(%'out'%);

      This generates the following output:

      <Data>
      <Field ecltype="decimal3"
      label="a"
      name="a"
      position="0"
      rawtype="131075"
      size="2"
      type="decimal"/>
      <Field ecltype="decimal3_1"
      label="b"
      name="b"
      position="1"
      rawtype="131075"
      size="2"
      type="decimal3_"/>
      </Data>

      Attachments

        Activity

          People

            richardkchapman Richard Chapman
            starsid Siddhartha Bagaria (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: