## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> | | RANDOM_TEXT[RANDOM_TEXT]:::quoted
RANDOM_TEXT --> End((END))
```
## Purpose
The `RANDOM_TEXT` SQL function generates a text with pseudo-random values taken from a list of possible characters.
See also [[RANDOM]] and [[RANDOM_BLOB]].
Parameters:
- Length (`int32`): Produce a text with this length in terms of characters.
- Candidates (`varchar2`): List of characters to choose from. The same character may appear multiple times.
Returns: A text with pseudo-random values.
## Examples
The following example generates a text of 10 pseudo-random characters taken from `abc`; the actual value differs per invocation:
```sql
select random_text(10, 'abc')
-------------------
bacbcabbca
```
The following example generates a text of 10 pseudo-random characters and retrieves the length in characters:
```sql
select length(random_text(10, '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'))
-------------------
10
```