• Font Size
  • S
  • M
  • L
  • Top Category > General Questions > DataSpider Servista > [DataSpider Servista] If I convert a string to a numeric type and calculate it in the To Number logic, I get an error that says the String type cannot be converted to a BigDecimal type.

Search via FAQ No.


  • No : 30769
  • Open Date : 2019/09/05 16:07
  • Print
NEW

[DataSpider Servista] If I convert a string to a numeric type and calculate it in the To Number logic, I get an error that says the String type cannot be converted to a BigDecimal type.

The following error occurred when I tried to use the To Number logic to change a string to a numeric type and calculate it. Please tell me about the cause and workaround.
 
Error Message
---
Convert Logic - Could not convert from String type to BigDecimal type
---
 
Category : 

Answer

■About the Error
 The error message "Could not convert from String type to BigDecimal type" occurs because the string used as input data cannot be converted to a numeric type.

■Probable cause
 It is assumed that the error message is output because the input data contains a string that cannot be converted by the [To Number] logic.

■Workaround
 Please make sure that the log level is set to DEBUG and any string that cannot be converted to a numeric type (such as a null character or a comma) is not used as input data, and do not include any string that cannot be converted to a numeric type.
 
 Example:

  • In case of null characters or null, convert to 0 using the Mapper's Replace Null/Empty String logic before converting it to a numeric value.
  • In case of commas, remove any comma included in data using the Mapper's Replace by Regular Expression logic.

■Supplementary

  • Internal data type of the Numeric logic

A numeric type that Mapper handles processes it in a BigDecimal type that can accurately represent data with decimal points.
If a string is used in a calculation, it is converted to the BigDecimal type and processed.

■Note
 If the log level is set to DEBUG, you can expect the log file to grow in size due to the increased amount of log output. Please change the level after confirming the free space of a disk to which the execution log is output.
 
Reference Information

  • [Property Reference]-[Server Property File]-[dslog.properties]

URL:https://www.hulft.com/help/en-us/DataSpider/dss42sp2/help/en/servista/properties_reference.html#server.log

  • [Designer]-[Menu]-[Tool Menu]

URL:https://www.hulft.com/help/en-us/DataSpider/dss42sp2/help/en/designer/designer.html#tool_menu

  • [Mapper]-[Mapper Logic Guide]-[String]-[ Replace Null/Empty String]

URL:https://www.hulft.com/help/en-us/DataSpider/dss42sp2/help/en/mapper/document/logic/replaceNullBlankWithNumber.html

  • [Mapper]-[Mapper Logic Guide]-[String]-[Replace by Regular Expression]

URL:https://www.hulft.com/help/en-us/DataSpider/dss42sp2/help/en/mapper/document/logic/replace.html

 
Version Information
Ver.4.1、Ver.4.0、Ver.3.2