Skip to main content
poojas0006
December 13, 2021
Question

Decimal (18,9) value in SQL from Appian

  • December 13, 2021
  • 2 replies
  • 0 views

Hello,

Client wants to have Decimal(18,9) in SQL db as this DB is being used by others as well. But when we try to insert it using Appian either it converts to exponential or gives error as CDT field we have created decimal type.

If I am doing todecimal then also it gives error.

Please let me know what shud we do so that atleast 18 digits we can save , I know Appian dosnt support 9 percision after decimal so it would be hard but if someone could suggest workaround so that we can save in DB decinal (18,9).

Not all the values are comming from Appian interface , few values we are fething from third party system also.

Thanks,

Pooja

    2 replies

    December 13, 2021

    You can keep the CDT field type in Appian as string and map it to a DECIMAL (18, 9) column in the back end database. For instance the xsd element in your cdt can be as follows -

    
        
            @Column(name="decValue", columnDefinition="DECIMAL")
        
    

    On the Appian interface, use a text field to capture this value from user but make sure it is validated for decimal (18, 9) or else database write will fail.

    poojas0006
    December 14, 2021

    Thanks for the suggestion but it is giving error

    An error occurred while trying to write to the entity "CO_TEST_BASE1123" [id=49b9c55e-18cf-4f44-b9e3-ad62fb06f852@1514, type=CO_TEST_BASERATE (id=8968)] (data store: LOAN_BUSINESSDATASTORE). Details: org.hibernate.exception.SQLGrammarException: could not load an entity: [COTESTBASERATEDT7997#1.234568e+18]: com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type nvarchar to numeric. Data: TypedValue[it=8968,v={1.234568e+18}]