Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am having a issue at the time of load Bigdecimal data in the tMSSqlConnection component. It is not able to process all the data.
At input My Schema setup is :
Description of schema setup | Column | key | Type | Null | Date Pattern | Length | Pricision |
Input | Hours | String | * | 5 | |||
output | Hrs | BigDecimal | * | * | 4 | 4 |
Bigdecimal Conversion logic is:
Relational.ISNULL(row1.Hours) ? new BigDecimal("0"):
StringHandling.LEN(row1.Hours) == 0 ? new BigDecimal("0"):
new BigDecimal(StringHandling.TRIM(row1.Hours))
The conversion logic is working perfectly as I am able to write data in a CSV file without issue.
Input data:
Input Data as string | Processed as BegDecimal | Rejected In SQLInput |
0.3 | 0.3000 | |
0.8 | .8000 | |
1 | rejected | |
4.3 | rejected |
As per my understanding the isuue may be with the input schema setup for Hrs column or I have to
convert string to BigDecimal in a different way. It is able to process data incase of decimal values(0.3)
but failing to load data(1 or 4.3).
The error I am getting is in below at the time of writing to database:
Please advice:
[statistics] connected
Data truncation
[ERROR]: talend_default.t_input_file_0_1.t_input_file - tMSSqlOutput_1 - Data truncation
Data truncation
[ERROR]: talend_default.t_input_file_0_1.t_input_file - tMSSqlOutput_1 - Data truncation
Data truncation
Data truncation
[ERROR]: talend_default.t_input_file_0_1.t_input_file - tMSSqlOutput_1 - Data truncation
[ERROR]: talend_default.t_input_file_0_1.t_input_file - tMSSqlOutput_1 - Data truncation
Data truncation
Data truncation
[ERROR]: talend_default.t_input_file_0_1.t_input_file - tMSSqlOutput_1 - Data truncation
[ERROR]: talend_default.t_input_file_0_1.t_input_file - tMSSqlOutput_1 - Data truncation
I am not sure what is the problem at the time of converting the decimal point. I did a quick fix just change the data type from Bigdecimal to Float in database ([real] null side. So instead of Bigdecimal, I have to change the type to Float in talend. It is solved but should not have taken this alternative root. Bigdecimal in SQL database side failed to handle any value > .99.