---
title: "HTMLENCODE"
description: "The HTMLENCODE SQL function returns the input text encoded as HTML, with special characters replaced by their HTML representation."
language: ja
source_language: en
translation_state: pending
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/htmlencode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/htmlencode
updated: 2026-12-04T10:47:52Z
license: https://documentation.invantive.eu/ja/
---

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

## 目的
The `HTMLENCODE` SQL function returns the input text encoded as HTML, with special characters replaced by their HTML representation.

参照：[[HTMLDECODE]]。

パラメータ:
- Input (`varchar2`): the input which will be encoded to HTML from text.

Returns: A text which is the input encoded as HTML as `varchar2`.

## 例
The following example retrieves the HTML representation of a text:
```sql
select htmlencode('Big Spender & Johnson has > output than ACME')

----------------
Big Spender &amp; Johnson has &gt; output than ACME
```
The following example encodes a text with tags and quotes as HTML:
```sql
select htmlencode('<b>"bold"</b>')

----------------
&lt;b&gt;&quot;bold&quot;&lt;/b&gt;
```

