Skip to main content
New Participant
Apr 18, 2021 1:26 AM UTC
Question

Map CDT value Decimal to a column in SQL

Hi,

I have Question on adding a new field with Number(decimal) as type in CDT by using XSD Uploading, i am in confuse situation where what will the following values for Decimal?? is it decimal or float or double in XSD file

</xsd:element>
<xsd:element name="Amount" nillable="true" type="xsd:double">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Column(name="AMOUNT", length=255)</xsd:appinfo>

If needed to Map the same field to Database SQL what will be AMOUNT column will be?? is it decimal or Double or Float or something else and also does length also be mentioned??

    1 reply

    Participating Frequently
    Apr 18, 2021 9:59 AM UTC

    Hi [mention:55cf2fedd9cd4d0ca7159f04ae29e3b9:e9ed411860ed4f2ba0265705b8793d05], you need to use double or float to represent a decimal datatype in the XSD file. There are size and length constraints for float (4 bytes, 7 digits) and double (8 bytes, 15-16 digits). Length does not need to be mentioned in this case. The column in the database also needs to be of the same name and datatype.

    Here is how it should look like:

    <xsd:element name="remunerationAmount" nillable="true" type="xsd:double">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="remunerationAmount", columnDefinition="DOUBLE")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>