invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

LENGTH

Syntax

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

Purpose

The LENGTH SQL function gets for a varchar2 the number of characters in provided text and for a blob the number of bytes in provided BLOB.

Parameters:

  • Input (blob or varchar2): the value to process.

Returns: the length of the input as an int32.

Examples

The following example retrieves the number of characters in a text:

select length('abcdefg')

----------------
7

The following example retrieves the number of bytes in a blob:

select length(random_blob(512))

----------------
512