## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> | | BARCODE_QR[BARCODE_QR]:::quoted
BARCODE_QR --> End((END))
```
## Purpose
The `BARCODE_QR` SQL function generates an image representing a QR code.
See also [[BARCODE_QR_EPC]].
Parameters:
- Length (`int32`): width and height in pixels.
- Text (`varchar2`): text to include.
- Preferred version (optional, `int32`): preferred version.
- Error correction level (optional, `int32`): the level and related percentage of maximum loss.
Returns: A binary representation in PNG format of the QR code.
## Examples
The following example generates a QR code of 250 by 250 pixels linking to the Invantive website and retrieves whether the PNG image is not empty:
```sql
select length(barcode_qr(250, 250, 'https://invantive.com')) > 0
-------------------
true
```
The following example shows that no QR code is generated when the text is `null`; the output is empty:
```sql
select barcode_qr(250, 250, null)
-------------------
```