BASE64_ENCODE function [String]

Encodes data using the MIME base64 format and returns it as a 7-bit ASCII string.

Syntax
BASE64_ENCODE( string-expression )
Parameters
  • string-expression   The string that is to be encoded.

Returns

LONG VARCHAR

See also
Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The following retrieves data from a table containing images and returns it in ASCII format. The resulting string can be embedded into an email message, and then decoded by the recipient to retrieve the original image.

SELECT BASE64_ENCODE( image_data ) FROM IMAGES;