Softerra LDAP Administrator HelpShow AllHide All

SUBSTRING

Allows extracting a substring from the specified sting.

Syntax

SUBSTRING (value_expression FROM start_expression FOR length_expression )

Arguments

value_expression - string expression. The expression can be both a string constant or a calculated attribute value or a result of a string function.

start_expression - an integer defining the starting position of returned symbols.

length_expression - a positive integer defining the number of symbols of the value_expression expression that will be returned.

Examples

The following example converts the whenCreated LDAP attribute to a string and uses it in SUBSTRING function to extract first four characters (year value).

UPDATE "CN=John Walker,DC=com" 
SET $description = $givenName || SUBSTRING(CAST($whenCreated AS String) FROM 1 FOR 4)
SCOPE BASE;