
Anonymous
Not applicable
2008-03-19
07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Convert Integer to String
I need to convert a primary key Interger to a String.
In the tMap I have written: (REF.REF_ID).toString() but the following error appears: "cannot invoke toString() on the primitive type int".
How can I convert it?
Thanks
3,223 Views
- « Previous Replies
-
- 1
- 2
- Next Replies »
11 Replies

Contributor
2008-03-19
11:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try:
(new Integer(yourvalue)).toString()
hope this helps
(new Integer(yourvalue)).toString()
hope this helps
3,005 Views

Anonymous
Not applicable
2008-03-19
11:34 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or you can use ""+REF.REF_ID
3,009 Views

Anonymous
Not applicable
2008-03-19
02:06 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see the "Perl" tag associated to this topic, but I don't think you're using a Perl project as Perl do this kind of conversion automatically. Can you confirm you're using Java?
3,009 Views

Anonymous
Not applicable
2008-03-21
03:55 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excuse me for the wrong information: my project is in java!
The solution (new Integer(REF.REF_ID)).toString() seems to work.
I had tried the: ""+REF.REF_ID without success!!
Thanks to every body.
The solution (new Integer(REF.REF_ID)).toString() seems to work.
I had tried the: ""+REF.REF_ID without success!!
Thanks to every body.
3,009 Views

Anonymous
Not applicable
2008-03-21
04:05 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have replied to quick.
With the expression (new Integer(REF.REF_ID)).toString() the tMap expression builder don't make an error anymore. But the tMap component falls in error. The convertion of interger to string for a primary key is not possible.
With the expression (new Integer(REF.REF_ID)).toString() the tMap expression builder don't make an error anymore. But the tMap component falls in error. The convertion of interger to string for a primary key is not possible.
3,009 Views

Anonymous
Not applicable
2008-03-21
04:14 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try this:
String.valueOf(REF.REF_ID)
Best regards
shong
Try this:
String.valueOf(REF.REF_ID)
Best regards
shong
3,009 Views

Anonymous
Not applicable
2011-01-17
11:25 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi Shong, I am facing similar issue (converting string to char). My input schema is string/char and output schema is char column from OracleSP. It says datatype/argument mismatch when I run the job. Pls suggest.
3,009 Views

Contributor III
2014-08-05
01:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pratik
you can use tconvertType component for converting column of one data type to other data type in talend
Regards
Ashok
you can use tconvertType component for converting column of one data type to other data type in talend
Regards
Ashok
3,009 Views

Creator II
2014-08-07
06:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or you can Google it to find all the java conversions
3,009 Views

- « Previous Replies
-
- 1
- 2
- Next Replies »