UUDECODE v16

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're using the EDB Postgres 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 EDB Postgres Advanced Server configuration parameter utl_encode.uudecode_redwood to TRUE before invoking the EDB Postgres Advanced Server UUDECODE function on the Oracle-created data. For example, this situation might occur if you migrated Oracle tables containing uuencoded data to an EDB Postgres 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 EDB Postgres Advanced Server UUENCODE function. As a result, attempting to use the EDB Postgres 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're using the EDB Postgres Advanced Server UUDECODE function on uuencoded data created by the EDB Postgres Advanced Server UUENCODE function, then utl_encode.uudecode_redwood must be set to FALSE, which is the default setting.

Parameters

r

r contains the uuencoded string to translate to RAW.

Examples

Before executing the example, invoke the command:

SET bytea_output = escape;

This command escapes any nonprintable characters and to displays BYTEA or RAW values onscreen in readable form. For more information, see the Postgres core documentation.

This 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;
Output
                              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;
Output
     uudecode
-------------------
What is the date?
(1 row)