Skip to main content
Before you import bitmap data into the database, you need to serialize the data and encode the data as a Base64 string. When you import the Base64 string into the database, you need to convert the string into bitmap data. This function is used to convert Base64 strings into bitmap data. This function is supported from v2.3.

Syntax

Parameters

bitmap: The supported data type is VARCHAR. Before you load Bitmap data into the database, you can use Java or C++ to create a BitmapValue object, add an element, serialize the data, and encode the data as a Base64 string. Then, pass the Base64 string as an input parameter into this function.

Return value

Returns a value of the BITMAP type.

Examples

Create a database named bitmapdb and a table named bitmap. Use Stream Load to import JSON data into bitmap_table. During this process, use base64_to_bitmap to convert the Base64 string in the JSON file into bitmap data.
  1. Create a database and a table in the database. In this example, a Primary Key table is created.
  2. Use Stream Load to import JSON data into bitmap_table. Suppose there is a JSON file named simpledata. This file has the following content and userid is a Base64-encoded string.
    Use base64_to_bitmap to convert userid into a bitmap value.
  3. Query data from bitmap_table.