• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

#1 2010-01-05 13:49:50

mahendraps
New member
Registered: 2009-12-31
Posts: 5

[resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Hi,

Language: Java
Database used: Postgres 8.4 / Oracle 10g

I am trying to use tMap component to transform data from boolean type in Postgres to NUM in Oracle (e.g. if column has value false then insert 0)

This is needed as part of Data migration exercise. Some how I did not find way how to do it. I looked through component tConvertType but that does not seem to be helpful either.

Any help on how to achieve this?

Thanks,
Mahendra

Offline

#2 2010-01-06 10:28:46

shong
Talend team
Registered: 2007-08-29
Posts: 10299
Website

Re: [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Hello Mahendra
Try the following expression on tMap: eg:
tPostgresInput--row1--tMap--tOracleOutput

Code:

row1.columnName==false?0:1

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2010-01-06 10:46:06

mahendraps
New member
Registered: 2009-12-31
Posts: 5

Re: [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Hi Shong,

I tried the option suggested by you, but this does not work. I have uploaded the screen shot of the same.

The error message coming up after clicking "Test!" button is

"Type mismatch: cannot convert from int to BigDecimal"

Thanks,
Mahendra


Uploaded Images

Last edited by mahendraps (2010-01-06 10:55:52)

Offline

#4 2010-01-06 11:25:07

shong
Talend team
Registered: 2007-08-29
Posts: 10299
Website

Re: [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Hello
If the data type of output column is BigDecimal, try

Code:

row1.columnName==false?new BigDecimal(0) :new BigDecimal(1)

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#5 2010-01-06 11:42:20

mahendraps
New member
Registered: 2009-12-31
Posts: 5

Re: [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Thanks Shong,

this works.

However I am still getting the message "Exception in thread "main" java.lang.Error: Unresolved compilation problems: ".

Offline

#6 2010-01-06 15:16:20

shong
Talend team
Registered: 2007-08-29
Posts: 10299
Website

Re: [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Hello

However I am still getting the message "Exception in thread "main" java.lang.Error: Unresolved compilation problems: ".

Does it show the message when you click on 'Test' button? Don't worry, just forget it and I suggest you not to use 'Test' button, it always confuse user eventhough there are not compilation problems in the generated code.

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Data transformation (Postgres boolean -> Oracle NUM) - Migration

Board footer

Powered by FluxBB