[resolved] Getting equals cannot be resolved or is not a field Error in tmap?

One Star

[resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Hi all,
I add row1.internal.equals("y")?"Y":row1.internal in tmap. And 
internal  filed data type is character.When i run job i'm getting "equals cannot be resolved or is not a field" Error.
Thanks in Advance.
Regards,
Kumar.talend

Accepted Solutions
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Thanks Umesh.
It's working fine.But i'm try to Replace null value in tmap it is not working.
row1.internal.equals(null)?'':row1.internal or row1.internal==null?'':row1.internal
Thanks,
kumar

All Replies
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Hi Talend Kumar,
try this:
(row1.internal).equals("y")?"Y":row1.internal

MathurM
Five Stars

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

check with this statement. 
 row1.internal.equals('y')?'Y':row1.internal
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Thanks Umesh.
It's working fine.But i'm try to Replace null value in tmap it is not working.
row1.internal.equals(null)?'':row1.internal or row1.internal==null?'':row1.internal
Thanks,
kumar
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Looks like the variant without parenthesis and single quotes works
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Thanks Whitenorm,
Where should i remove parenthesis in logic?
Thanks,
kumar
Five Stars

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Try with this statement.
"null".equals(row1.internal) || row1.internal==null?' ':row1.internal

check once. 
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Hi Umesh,
Thanks a lot.
It is working.Here i have 2 doubt.
1)If have remove "space" in single quotes,statement is not working(row1.internal==null?'':row1.internal)?
2) Why statement is working for single quotes( like row1.internal.equals('y')?'Y':row1.internal)
    Not working for Double  quotes(like row1.internal.equals("y")?"Y":row1.internal?
Thanks,
kumar
Five Stars

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

your source and target data type is char which will expect char for comparing that is way double quotes not worked whereas single quotes worked. 
One Star

Re: [resolved] Getting equals cannot be resolved or is not a field Error in tmap?

Thanks Umesh