Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI
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?
Thanks
bb
Hello ,
I am able to decode zith below expression in tMap
new String(new sun.misc.BASE64Decoder().decodeBuffer(row1.newColumn), java.nio.charset.StandardCharsets.UTF_8);
to decode base64 , you could use simple java code in tjavarow or in tmap
this will help.
Hi
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
thanks bb
Hello ,
I am able to decode zith below expression in tMap
new String(new sun.misc.BASE64Decoder().decodeBuffer(row1.newColumn), java.nio.charset.StandardCharsets.UTF_8);
Hi Ahbishek,
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);
https://www.mkyong.com/java/how-do-convert-byte-array-to-string-in-java/