---
title: "XMLCOMMENT"
description: "The XMLCOMMENT SQL functions formats a text as an XML comment."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/xmlcomment
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/xmlcomment
updated: 2026-08-09T00: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)) --> XMLCOMMENT[XMLCOMMENT]:::quoted
    XMLCOMMENT --> End((END))
```

## Purpose
The `XMLCOMMENT` SQL functions formats a text as an XML comment.

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

Parameters:
- Input (`varchar2`): the input which will be formatted as XML comment.

Returns: A text with the input as XML comment.

## Examples
The following example formats the text `a -b c` as an XML comment:
```sql
select xmlcomment('a -b c')

-------------------
<!-- a -b c -->
```
The following example formats the text `a --b c` as an XML comment, separating the double hyphen which is not allowed within an XML comment:
```sql
select xmlcomment('a --b c')

-------------------
<!-- a - -b c -->
```