Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Tasfiahm
Creator
Creator

Bigdecimal converted data failing to load after using the tMSSqlConnection component

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

Labels (3)
1 Solution

Accepted Solutions
fdenis
Master
Master

what is your talend vession?
What is the sql format (SQL Table definition)!

To solve your problem you can cast all your Bigdecimal as String. your database is going to cast from string to numeric.

Regrads

View solution in original post

2 Replies
fdenis
Master
Master

what is your talend vession?
What is the sql format (SQL Table definition)!

To solve your problem you can cast all your Bigdecimal as String. your database is going to cast from string to numeric.

Regrads
Tasfiahm
Creator
Creator
Author

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] null0683p000009MA9p.png 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.