#1 2012-03-28 22:53:44

psreepa
New member
Registered: 2012-03-28
Posts: 8

Datatype Conversion

Hello Talend Folks,

I am new to Talend and trying to accomplish some intermediate operations in TMAP Component. I need to convert the data types in TMAP to work through my tasks.

I need to convert from String - > Number ; String - > NVarchar2 ; String -> Timestamp ; String -> Date

Any help on the above is deeply appreciated.

Thanks
psreepa

Offline

#2 2012-03-29 05:03:52

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Datatype Conversion

Hi Psreepa

Welcome to Talend Community!

String->Number: String->Int
Integer.parseInt(s)

String->NVarchar2:
No need to change.

String->Timestamp and String->Date: String->Date
TalendDate.parseDate(pattern, stringDate)

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-03-29 16:19:12

psreepa
New member
Registered: 2012-03-28
Posts: 8

Re: Datatype Conversion

Thanks for your quick response, Pedro.

I am getting an error after using TalendDate.parseDate("dd-mmm-yy",row2.Column0) . Do I also need to pick the date pattern? Source record is lik 2012-01-31 and my end result should look like 31-JAN-12.

Thx
Psreepa

Offline

#4 2012-03-30 04:03:10

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Datatype Conversion

Hi

You can change date pattern in tMap as the following image.

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

Board footer

Powered by FluxBB