Glob SQL Function
The Glob() function takes 2 (two) arguments and performs pattern based search. It works similar to LIKE function and i.e. Glob(A, B) checks if A is equals to B and returns 1 for true, 0 for false.
The GLOB function is different then GLOB Clause and performs case sensitive search.
Syntax for Like() function Like (Wildcard , String ).
Wildcards |
Description |
* |
Matches any number of characters including zero. |
? |
Matches exactly one character. |
/* Following will return 1 */
SELECT Glob('S*', 'SQLDatabase.Net');
/* Following will return 0 due to s and S as Glob is case sensitive */
SELECT Glob('s*', 'SQLDatabase.Net');
/* Following will return 1 */
SELECT Glob('SQLDatabase.???', 'SQLDatabase.Net');
/* Following will return 0 due to capital A in pattern */
SELECT Glob('*A\\?*', 'This is a\\ \\ string');