---
title: "XMLENCODE"
description: "The XMLENCODE SQL function returns the XML encoded input."
language: nb
source_language: en
translation_state: pending
canonical: https://documentation.invantive.eu/nb/docs/invantive-universalsql/grammar/sql-functions/xmlencode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/xmlencode
updated: 2026-12-04T14:30:10Z
license: https://documentation.invantive.eu/nb/
---

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

## Formål
The `XMLENCODE` SQL function returns the XML encoded input.

See also [[XMLCOMMENT]], [[XMLDECODE]], [[XMLELEMENT]], [[XMLFORMAT]] and [[XMLTRANSFORM]].

Parametere:
- Input (`varchar2`, `decimal` or `datetime`): the input which will be encoded into XML.

Returns: An object which is the XML encoded input.

## Eksempler
The following example encodes the text `John & CO`:
```sql
select xmlencode('John & CO')

-------------------
John &amp; CO
```
The following example encodes the text `65/20<5%`:
```sql
select xmlencode('65/20<5%')

-------------------
65/20&lt;5%
```

