Documentazione Invantiveparte di invantive cloud
Forum di supporto InvantiveAccedi / Registrati

SHORTEN

Sintassi

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

Scopo

La funzione SQL SHORTEN riduce un testo alla lunghezza massima consentita. Quando il testo supera la lunghezza massima, viene rimosso del testo dalla parte centrale, sostituendo il testo rimosso con un testo più breve.

Parametri:

  • Input (varchar2): testo da accorciare.
  • Lunghezza (int32): lunghezza massima del testo abbreviato.
  • Sostituzione (opzionale, varchar2): testo con cui sostituire il testo rimosso. Il valore predefinito è ....

Restituisce: il testo di input abbreviato alla lunghezza specificata.

Esempi

L'esempio seguente accorcia un testo fino a un massimo di 15 caratteri:

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

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

L'esempio seguente lascia il testo invariato poiché non supera la lunghezza massima:

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

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