GSAK (Geocaching Swiss Army Knife)
 

Contents - Index


SQL - String functions



chr(number)
Converts a decimal value to its ASCII equivalent. For example Chr(83) returns 'S'

left(expression,count)
Returns the first count characters of expression

lower(expression)
Converts (string) expression to lower case.

mid(expression,from,count)
Returns count characters of expression starting at from.

length(expression)
Returns the length of (string) expression. Can be used to e.g. select fields that exceed a given length.

replace(source,oldpattern,newpattern)
Replaces oldpattern with new pattern in the source string. Is case-insensitive.

UPDATE users SET username=replace(username,'user-','foo-')

right(expression,count)
Returns the last count characters of expression

soundex(expression)
Calculates the soundex value of (string) expression. Only useful with english terms.

substr_after(source,substring)
Returns the part of source that comes after substring. If substring is not found an empty string is returned.

substr_before(source,substring)
Returns the part of source that comes before substring. If substring is not found an empty string is returned.

trim(expression)
Trims (string) expression from leading and trailing spaces.

upper(expression)
Converts (string) expression to upper case.


Copyright 2004-2008 CWE Computer Services  
Privacy Policy Contact