UUDECODE¶
Use the UUDECODE function to translate and decode a uuencode encoded
string to the RAW value that was originally encoded by the UUENCODE
function. The signature is:
UUDECODE(<r> IN RAW)
This function returns a RAW value.
If you are using the Advanced Server UUDECODE function to decode uuencoded data that was created by the Oracle implementation of the UTL_ENCODE.UUENCODE function, then you must first set the Advanced Server configuration parameter utl_encode.uudecode_redwood to TRUE before invoking the Advanced Server UUDECODE function on the Oracle-created data. (For example, this situation may occur if you migrated Oracle tables containing uuencoded data to an Advanced Server database.)
The uuencoded data created by the Oracle version of the UUENCODE
function results in a format that differs from the uuencoded data
created by the Advanced Server UUENCODE function. As a result,
attempting to use the Advanced Server UUDECODE function on the Oracle
uuencoded data results in an error unless the configuration parameter
utl_encode.uudecode_redwood is set to TRUE.
However, if you are using the Advanced Server UUDECODE function on
uuencoded data created by the Advanced Server UUENCODE function, then
utl_encode.uudecode_redwood must be set to FALSE, which is the default
setting.
Parameters
r
rcontains the uuencoded string that will be translated toRAW.
Examples
Before executing the following example, invoke the command:
SET bytea_output = escape;
This command instructs the server to escape any non-printable characters, and to display BYTEA or RAW values onscreen in readable form. For more information, refer to the Postgres Core Documentation available at:
The following example uses UUENCODE and UUDECODE to first encode and
then decode a string:
edb=# SET bytea_output = escape;
SET
edb=# SELECT UTL_ENCODE.UUENCODE('What is the date?') FROM DUAL;
uuencode
--------------------------------------------------------------------
begin 0 uuencode.txt\01215VAA="!I<R!T:&4@9&%T93\\`\012`\012end\012
(1 row)
edb=# SELECT UTL_ENCODE.UUDECODE
edb-# ('begin 0 uuencode.txt\01215VAA="!I<R!T:&4@9&%T93\\`\012`\012end\012')
edb-# FROM DUAL;
uudecode
-------------------
What is the date?
(1 row)