Documentación de Invantiveparte de Invantive Cloud
Foros de Soporte de InvantiveIniciar Sesión / Registrarse

TRADUCIR

Sintaxis

%%{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))

Propósito

La función SQL TRANSLATE sustituye todas las apariciones de cada carácter de from_string por su carácter correspondiente en to_string.

Véase también REPLACE.

Parámetros:

  • input (varchar2): El texto que sustituye una secuencia de caracteres por otro conjunto de caracteres.
  • from_string (varchar2): El texto que se buscará en el campo de entrada.
  • to_string (varchar2): Todos los caracteres de la imagen from_string se sustituirán por el carácter correspondiente de la imagen to_string.

Resultado: la entrada en la que todas las apariciones de cada carácter en from_string se han sustituido por su carácter correspondiente en to_string.

Ejemplos

En el siguiente ejemplo, los caracteres *, , / y - se sustituyen, cada uno de ellos, por _, y se elimina el carácter ', ya que no tiene ningún carácter correspondiente en to_string:

select translate('some*text to/be testing-wit''h', '* /-''', '____')

----------------------------
some_text_to_be_testing_with

El siguiente ejemplo devuelve la entrada sin cambios, ya que ninguno de los caracteres de from_string aparece en la entrada:

select translate('some*text to/be testing-wit''h', '_____', '_____')

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