Difference between revisions of "LIKE()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 35: Line 35:
  
 
{| class="wikitable"
 
{| class="wikitable"
!Characters||
+
!Characters||Description
==Description==
+
 
|-
 
|-
 
|_||Matches any one character
 
|_||Matches any one character

Revision as of 12:13, 23 March 2009

Class

String Data


Purpose

Function to compare two strings for similarities


Syntax

LIKE(<expC1>, <expC2>)


See Also

SOUNDEX(), STRTRAN()


Description

The LIKE() function is used to compare two character strings for matching qualities. The <expC1> specifies the matching pattern to look for. The <expC2> specifies the string in which to look. The <expC1> accepts "wildcard" characters with which to construct the pattern. Wildcard characters may represent upper case or lower case characters, but specific characters are case sensitive. The Recital/4GL supports the following wildcard characters:


Characters Description
? Matches any one character
% Synonymous with ?
* Matches zero or more characters


If the LIKE() function is used in SQL mode (SET SQL ON or embedded EXEC SQL statements), the following wildcard characters are available:


Characters Description
_ Matches any one character
% Matches zero or more characters


The LIKE() function returns .T. if a matching pattern is found, or .F. otherwise.


Example

?like("*Recital*", "This is Recital")
.T.


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer