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

SHORTEN

Sintaxis

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

Propósito

La función SQL SHORTEN reduce un texto a una longitud máxima. Cuando el texto supera la longitud máxima, se elimina texto del centro y se sustituye por un texto más corto.

Parámetros:

  • Entrada (varchar2): Texto que se va a acortar.
  • Longitud (int32): Longitud máxima del texto acortado.
  • Sustitución (opcional, varchar2): Texto por el que se sustituye el texto eliminado. El valor por defecto es ....

Devuelve: el texto de entrada acortado a la longitud especificada.

Ejemplos

El siguiente ejemplo acorta un texto hasta un máximo de 15 caracteres:

select shorten('The quick brown fox jumps over the lazy dog', 15)

-------------------
The qu...zy dog

En el siguiente ejemplo, el texto no se modifica, ya que no supera la longitud máxima:

select shorten('The quick brown fox', 50)

-------------------
The quick brown fox