You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
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
Hello Mahendra
Try the following expression on tMap: eg:
tPostgresInput--row1--tMap--tOracleOutput
row1.columnName==false?0:1
Best regards
shong
Offline
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
Last edited by mahendraps (2010-01-06 10:55:52)
Offline
Hello
If the data type of output column is BigDecimal, try
row1.columnName==false?new BigDecimal(0) :new BigDecimal(1)
Best regards
shong
Offline
Thanks Shong,
this works.
However I am still getting the message "Exception in thread "main" java.lang.Error: Unresolved compilation problems: ".
Offline
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
Offline
Pages: 1