我看到Oracle提供了一个utl_encode,但不会用。能否给个简单的例子?

解决方案 »

  1.   

    PL/SQL Packages UTL_ENCODEEncode RAW data into a standard encoded format so that the data can be transported between hosts.
    Also contains the decode counterpart. Typically used to encode the body of email text.Functions:BASE64_ENCODE Function 
                    Encode the binary representation of the RAW value
                    into base 64 elements and return it in the form of
                    a RAW string BASE64_DECODE Function
                    Read the base 64-encoded RAW input string and decode
                    it to its original RAW value UUENCODE Function
                    Read the RAW input string and encode it to the
                    corresponding uuencode format string UUDECODE Function
                    Read the RAW uuencode format input string and
                    decode it to the corresponding RAW string QUOTED_PRINTABLE_ENCODE Function
                    Read the RAW input string and encode it to the
                    corresponding quoted printable format string QUOTED_PRINTABLE_DECODE Function
                    Read the varchar2 quoted printable format input
                    string and decode it to the corresponding RAW string  such as
    ---------------------------------------
    BASE64_ENCODE Function
    This function encodes the binary representation of the RAW value into base 64 elements and returns it in the form of a RAW string.Syntax
    UTL_ENCODE.BASE64_ENCODE (
       r  IN RAW) 
    RETURN RAW;Pragmas
    pragma RESTRICT_REFERENCES(base64_encode, WNDS, RNDS, WNPS, RNPS);Parameters
    Table 94-2 BASE64_ENCODE Function Parameters
    Parameter Description 
    r
     The RAW value to be encoded. There are no defaults or optional parameters.
     Returns
    Table 94-3 BASE64_ENCODE Function Returns
    Return Description 
    RAW
     Contains the encoded base 64 elements