Softerra LDAP Administrator HelpShow AllHide All

POSITION

Searches expression_dest for expression_for and returns its starting position if found. Otherwise returns 0.

Syntax

POSITION (expression_for IN expression_dest)

Arguments

expression_dest - a character expression that contains the sequence to be found.

expression_for - a character expression to be searched.

Examples

The following example searches for all users that has word 'sales' in their department attribute.

SELECT $department FROM "OU=Users,DC=company"
WHERE $objectCategory='Person' AND $objectClass='user'
    AND EXISTS $department AND POSITION($department for 'sales')>0;

In this example, POSITION function is used to determine whether the department attribute contain word 'sales'.