SET STRCOMPARE

From Lianjapedia
Jump to: navigation, search

Purpose

Determines how string comparisons are performed

Syntax

SET STRCOMPARE ON | OFF | (<expL>)

See Also

LEFT(), Lianja Operators, LPAD(), LTRIM(), RIGHT(), RPAD(), RTRIM(), SET EXACT, SOUNDEX(), SUBSTR(), TRIM()

Description

If SET STRCOMPARE is ON, strings are automatically trimmed and the comparison is case insensitive. If SET STRCOMPARE is OFF, the strings compared must be a match in characters, case and length.

With SET STRCOMPARE ON, index searches and SQL queries are also case-insensitive.

Lianja v1.5 By default, STRCOMPARE is ON in Lianja SQL Server and Lianja Cloud Server and OFF in Lianja App Builder / App Center.

Lianja v2.0 By default, STRCOMPARE is ON in Lianja SQL Server, Lianja Cloud Server, Lianja App Builder and App Center. To use SET EXACT OFF for partial string comparisons, SET STRCOMPARE should also be set OFF.

For partial string comparisons, also see the use of == with pattern matching characters here: Comparison Operators.

Example

set strcompare off
? "HELLO " = "hello"
.F.
set strcompare on
? "HELLO " = "hello"
.T.