---
title: "CSVDECODE"
description: "The CSVDECODE SQL function returns the input text decoded as CSV adhering to RFC 4180."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/csvdecode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/csvdecode
updated: 2026-10-22T00: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)) --> CSVDECODE[CSVDECODE]:::quoted
    CSVDECODE --> End((END))
```

## Purpose
The `CSVDECODE` SQL function returns the input text decoded as CSV adhering to [RFC 4180](https://www.rfc-editor.org/rfc/rfc4180):
- field separator `,`
- record separator CR, LF and CR/LF
- quoting character `"`
- escaped quoting character `\"`
- no headers

See also [[CSVENCODE]].

Parameters:
- Input (`varchar2`): the input which will be decoded from CSV to text.

Returns: A text which is the CSV decoded input as `varchar2`.

## Examples
The following example retrieves the text representation of the CSV encoded value `"a,b,c,d"`:
```sql
select csvdecode('"a,b,c,d"')

----------------
a,b,c,d
```
The following example retrieves the text representation of the CSV encoded value `text`:
```sql
select csvdecode('text')

----------------
text
```