Four Stars

Error in tmap expression syntax

HI all,

Can any one please suggest me on below expression in tmap component.

Scenario: I am trying to filter the records in tmap component using below expression, but unfortunately i am getting expression syntax error.

row.EMPNO==7839

error message: Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

please suggest me on the above error.

 

thanks,

Hareesh

5 REPLIES
Twelve Stars TRF
Twelve Stars

Re: Error in tmap expression syntax

Hi,

 

You miss the row number in the expression "row.EMPNO==7839".

Should be "rowX" where "X" depends on your job design.

 

In case you just forgot "X" in the post, is EMPNO an integer?

Then if it's a String, replace the expression by the following if it makes sense:

"7839".equals(rowX.EMPNO)

or this one to convert EMPNO before the evaluation:

Integer.parseInt(rowX.EMPNO) == 7839

Hope this helps.


TRF
Four Stars

Re: Error in tmap expression syntax

HI,

 

thanks for your input.

i tried with below approach but it didn't work.

In case you just forgot "X" in the post, is EMPNO an integer?--- Yes I forgot the X

  is EMPNO an integer??--- No EMPNO is BigDecimal

tried the below expressions both:

 Integer.ParseInt(row1.EMPNO)==7839...it didn't work

 could you please look into it.

Twelve Stars TRF
Twelve Stars

Re: Error in tmap expression syntax

So, transform you 7839 to a BigDecimal before the camparison:

BigInteger.valueOf(7839).compareTo(row1.EMPNO)

Should work.


TRF
Four Stars

Re: Error in tmap expression syntax

Hi ,

 

I tried with below given expression but it was giving an error BigInteger cannot be resolved.

 

So i tired using tConvertType component to convert my BigDecimal to Integer then filtered it. so it is working now.

please do let me know do you any documented related to all converstion types???

thanks.

Twelve Stars TRF
Twelve Stars

Re: Error in tmap expression syntax

You're right.

You need to import java.math.BigInteger first. 

Google should help you to learn all about datatype conversion.

Don't forget to close the case for other people facing the same issue.

Kudos also accepted for the given time.


TRF