Softerra LDAP Administrator HelpShow AllHide All

CAST

Converts the expression of one data type into another.

Syntax

CAST (expression AS data_type)

Arguments

expression - any acceptable expression.

data_type - target data type. for further information about available data types refer to the Data Types section.

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;

Here is the result.

'John2010'