SQL - Encode/decode function (base64)

From GUILLARD WIKI
Revision as of 13:59, 23 August 2016 by Guillard (talk | contribs) (Created page with "<code> set define off; </code> - Encode<br/> <code>SELECT UTL_RAW.cast_to_varchar2(</code><br/>   <code>UTL_ENCODE.base64_encode(</code><br/>   <code>UTL_...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

set define off;

- Encode
SELECT UTL_RAW.cast_to_varchar2(
  UTL_ENCODE.base64_encode(
  UTL_RAW.cast_to_raw('Surf the world, travel & eat as much as u can... xo xo T.')))
FROM dual;


- Decode
SELECT UTL_RAW.cast_to_varchar2(/code>
  UTL_encode.base64_decode(
  UTL_RAW.cast_to_raw('U3VyZiB0aGUgd29ybGQsIGxvdmUgdGhlIHdvbWVuLCBlYXQgYXMgbXVjaCBhcyB1IGNhbi4uLiB4byB4byBULg=='))) "42"
FROM dual;