Error while assign values to null in tmap

Highlighted
Five Stars

Error while assign values to null in tmap

I'm creating 2 variables in tmap and need to assign value to a null.

 

Source:

 

Deleted column is boolean type

SVamount column is BigDecimal type

 

Vars are created using this:

row10.Deleted==null?1:row10.Deleted 

row10.SVamount==null?new BigDecimal(0):row10.SVamount

 

When I take these two vars on the output filter, it errors out with.

Type mismatch:  cannot convert from ObjectComparable<?>Serializable to boolean.

 

 

 


Accepted Solutions
Forteen Stars

Re: Error while assign values to null in tmap

@rp2018,you need to use below way for vars.since 1 will not able to convert to Boolean.

Vars are created using this:

row10.Deleted==null?true:row10.Deleted 

row10.SVamount==null?new BigDecimal(0):row10.SVamount

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Forteen Stars

Re: Error while assign values to null in tmap

@rp2018,you need to use below way for vars.since 1 will not able to convert to Boolean.

Vars are created using this:

row10.Deleted==null?true:row10.Deleted 

row10.SVamount==null?new BigDecimal(0):row10.SVamount

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch