Page 1 of 1

Base64 Encoding

Posted: Tue Oct 23, 2012 1:11 pm
by MrBlack
Does anyone know how to take text and encode to base 64?

My data is xml text stored as a blob in the database. Then I'm pushing this into a web service.

Posted: Tue Oct 23, 2012 3:45 pm
by ray.wurlod
Depending on the database, there should be a function called something like RAWTOHEX. Use that in a user-defined SELECT statement.

Posted: Wed Oct 24, 2012 2:04 pm
by MrBlack
I tried going that route to have my database do the conversion but there were issues of data length limitations plus I felt as if there should be a pure datastage solution because I may not always be reading from a database. So I did some research and wrote a routine that I can us in my transformer. This gives me the flexibility changing out my data source and always being able to do base64 encoding.

If anyone else is wondering how to write a routine I used this link for the conversion methodology: http://en.wikipedia.org/wiki/Base64