[resolved] Cannot convert from char to string

One Star

[resolved] Cannot convert from char to string

Hi,
I'm trying to do a lookup on an incoming column which is string and the column from the lookup file is also a string.
The transformation on the main column  is as follows which is applied while doing the lookup.
StringHandling.LEFT(row1.main_column,2) 

The error thrown is Cannot convert from char to string.
I tried using the valueof method as well but no luck.
Any ideas please?
Thanks

Accepted Solutions
One Star

Re: [resolved] Cannot convert from char to string

Thank you for the response.
The issue was apparently not being caused by the substring function but actually an empty string that was being passed to a column in the tmap. Instead of using double quotes, single quote was used and hence the cryptic error message Smiley Happy.
Thanks again.

All Replies
Community Manager

Re: [resolved] Cannot convert from char to string

Can you take a screenshot of your job and the tMap that you are carrying out this logic in? It seems an odd message for what you have described. Also, could you click on the "code" tab (in the bottom left of the Talend workspace) and look for a red block on the right hand side of the code window. Click on that to take you to the area of broken code. Take a screenshot of that and post it. That should give us enough information to help you. 
You may struggle to post screen shots as you have not posted enough. Just post a couple of comments under this message to get you up to 10 posts, then you will be able to post images.
One Star

Re: [resolved] Cannot convert from char to string

Thank you for the response.
The issue was apparently not being caused by the substring function but actually an empty string that was being passed to a column in the tmap. Instead of using double quotes, single quote was used and hence the cryptic error message Smiley Happy.
Thanks again.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now