---
title: "RANDOM_BLOB"
description: "The RANDOM_BLOB SQL function generates a blob with pseudo-random values."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/random-blob
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/random-blob
updated: 2026-10-08T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> RANDOM_BLOB[RANDOM_BLOB]:::quoted
    RANDOM_BLOB --> End((END))
```

## Purpose
The `RANDOM_BLOB` SQL function generates a `blob` with pseudo-random values.

See also [[RANDOM]], [[RANDOM_TEXT]] and [[ZERO_BLOB]].

Parameters:
- Length (`int32`): Produce a `blob` with this length in terms of bytes, from 0 to 67,108,864.

Returns: A `blob` with pseudo-random values.

## Examples
The following example generates a `blob` of 100 pseudo-random bytes and retrieves the length in bytes:
```sql
select length(random_blob(100))

-------------------
100
```
The following example returns `null` since the length is `null`:
```sql
select random_blob(null)

-------------------

```