UUENCODE v17
Use the UUENCODE function to translate RAW data into a uuencode formatted encoded string. The signature is:
UUENCODE(<r> IN RAW, <type> IN INTEGER DEFAULT 1, <filename> IN VARCHAR2 DEFAULT NULL, <permission> IN VARCHAR2 DEFAULT NULL)
This function returns a RAW value.
Parameters
r
r contains the RAW string to translate to uuencode format.
type
type is an INTEGER value or constant that specifies the type of uuencoded string that to return. The default value is 1. The possible values are:
| Value | Constant |
|---|---|
1 | complete |
2 | header_piece |
3 | middle_piece |
4 | end_piece |
filename
filename is a VARCHAR2 value that specifies the file name that you want to embed in the encoded form. If you don't specify a file name, UUENCODE includes a file name of uuencode.txt in the encoded form.
permission
permission is a VARCHAR2 that specifies the permission mode. The default value is NULL.
Examples
Before executing the example, invoke the command:
SET bytea_output = escape;
This command escapes any nonprintable characters and 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;
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)
- On this page
- Parameters
- Examples