SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite ZEROBLOB() Function



The SQLite ZEROBLOB() function returns a BLOB consisting of N bytes of 0x00. SQLite manages these zeroblobs very efficiently. Zeroblobs can be used to reserve space for a BLOB that is later written using incremental BLOB I/O.

Syntax

ZEROBLOB(N)

Parameters

N Required. Specify the number of bytes.

Return Value

Returns a BLOB consisting of N bytes of 0x00.

Example: ZEROBLOB() example

The example below shows the usage of ZEROBLOB() function.

SELECT HEX(ZEROBLOB(8));
Result: '0000000000000000'

SELECT HEX(ZEROBLOB(16));
Result: '00000000000000000000000000000000'

❮ SQLite Functions