35.7 CLOBBASE642BLOB Function

Use this function to convert a CLOB datatype that is base64 encoded into a BLOB. This is often used when receiving output from a Web service that contains a binary parameter.

Syntax

APEX_WEB_SERVICE.CLOBBASE642BLOB (
            p_clob IN CLOB)
RETURN BLOB;

Parameters

Table 35-2 CLOBBASE642BLOB Parameters

Parameter Description

p_clob

The base64 encoded CLOB to convert into a BLOB.

Example

The following example retrieves a base64 encoded node from an XML document as a CLOB and converts it into a BLOB.

declare
            l_base64    CLOB;
    l_blob      BLOB;
    l_xml       XMLTYPE;
begin
    l_base64 := apex_web_service.parse_xml_clob(l_xml, ' //runReportReturn/reportBytes/text()');
        l_blob := apex_web_service.clobbase642blob(l_base64);
end;