---
title: "XMLENCODE"
description: "La funci\u00F3n SQL XMLENCODE devuelve la entrada codificada en XML."
language: es
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/es/docs/invantive-universalsql/grammar/sql-functions/xmlencode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/xmlencode
updated: 2026-12-02T12:11:54Z
license: https://documentation.invantive.eu/es/
---

## Sintaxis
```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))
```

## Propósito
La función SQL `XMLENCODE` devuelve la entrada codificada en XML.

Véase también [[XMLCOMMENT]], [[XMLDECODE]], [[XMLELEMENT]], [[XMLFORMAT]] y [[XMLTRANSFORM]].

Parámetros:
- Entrada (`varchar2`, `decimal` o `datetime`): la entrada que se codificará en XML.

Devuelve: Un objeto que representa la entrada codificada en XML.

## Ejemplos
El siguiente ejemplo codifica el texto `John & CO`:
```sql
select xmlencode('John & CO')

-------------------
John &amp; CO
```
El siguiente ejemplo codifica el texto `65/20<5%`:
```sql
select xmlencode('65/20<5%')

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

