I'm extracting an salesforce module where a column is base64 encoded, i need to decrypt and load into an oracle table.
I have this oracle function "UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_DECODE(incput_column))", any idea how i can use this function in the "Advanced setting>Additional column" in tOracleputput component? or is there any talend function available to decode base64 column?
Solved! Go to Solution.
to decode base64 , you could use simple java code in tjavarow or in tmap
this will help.
I did saw that link before posting it, i don't want to use the tjavarow, i did tried various combinations in the tmap, but not successful, can someone show me an example of how to use those functions in the tmap, when i tried i'm getting error "BASE64Decoder cannot be resolved" and i tried other links such as "https://stackoverflow.com/questions/2817752/java-code-to-convert-byte-to-hexadecimal", but nothing worked out.
also i found this function in oracle ""UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_DECODE(RAWTOHEX ()))" when i tried it in the toracleoutput>advanced settings>additional columns"
this didn't worked as well.the main question using the above function is, how to use the incoming row from tmap in this function?
can someone show me an example of both the java functions in tmap and using the oracle function in in the toracleoutput
I figured it out, instead of using tconvertertype, i used the java string function, its working fine... thank a lot, much appreciated.
new String(new sun.misc.BASE64Decoder().decodeBuffer(new String(row1.VersionData) ), java.nio.charset.StandardCharsets.UTF_8);
Join us at the Community Lounge.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Test drive Talend's enterprise products.