---
title: "TRANSLATE"
description: "TRANSLATE SQL\u95A2\u6570\u306F\u3001from_string\u5185\u306E\u5404\u6587\u5B57\u306E\u3059\u3079\u3066\u306E\u51FA\u73FE\u3092\u3001to_string\u5185\u306E\u5BFE\u5FDC\u3059\u308B\u6587\u5B57\u306B\u7F6E\u304D\u63DB\u3048\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/translate
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/translate
updated: 2026-12-04T14:39:05Z
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)) --> TRANSLATE[TRANSLATE]:::quoted
    TRANSLATE --> End((END))
```

## 目的
`TRANSLATE` SQL関数は、`from_string`内の各文字のすべての出現を、`to_string`内の対応する文字に置き換えます。

参照：[[REPLACE]]。

パラメータ:
- `input`（`varchar2`）：一連の文字を別の文字の集合で置き換えるためのテキストです。
- `from_string`（`varchar2`）：入力内で検索される対象のテキストです。
- `to_string`（`varchar2`）：`from_string`内のすべての文字は、`to_string`内の対応する文字に置き換えられます。

戻り値：`from_string`内の各文字のすべての出現を、`to_string`内の対応する文字に置き換えた入力値。

## 例
次の例では、文字`*`、` `、`/`、`-`をそれぞれ`_`に置き換え、`to_string`に対応する文字がないため文字`'`を削除します：
```sql
select translate('some*text to/be testing-wit''h', '* /-''', '____')

----------------------------
some_text_to_be_testing_with
```
次の例では、`from_string`内のいずれの文字も入力に出現しないため、入力値をそのまま返します：
```sql
select translate('some*text to/be testing-wit''h', '_____', '_____')

-----------------------------
some*text to/be testing-wit'h
```

