Last active
April 20, 2024 07:21
-
-
Save foobarbaz-pl/4100b45ac1ff60dd2a6c8dda993470bc to your computer and use it in GitHub Desktop.
[PL/SQL Base64 encode decode] #oracle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
r raw(32767); | |
begin | |
r := utl_raw.cast_to_raw('Test'); | |
dbms_output.put_line(r); | |
r := utl_encode.base64_encode(r); | |
dbms_output.put_line(utl_raw.cast_to_varchar2(r)); | |
r := utl_encode.base64_decode(r); | |
dbms_output.put_line(utl_raw.cast_to_varchar2(r)); | |
end; | |
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('Aladdin:open sesame'))) | |
from dual; | |
select utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw('QWxhZGRpbjpvcGVuIHNlc2FtZQ=='))) | |
from dual; |
will this work for large string like CLOB types ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
THANKS!!!!!! i love this.