picoSQL - Language reference manual

5.3) String functions

In the following descriptions, we denote a string expression as string or string-1, string-2 etc.


Returns a numeric value corresponding to the ASCII value of the first character of string.


Returns a string 1 character long whose ASCII value is equal to num-expr.

CONCAT(string-1, string-2)

Concatenates two strings into one large string.


Returns a string containing the representation of num-expr.


Converts a string in a number. If the value contained in string cannot be interpreted as a number, then this function returns 0.


Returns a string containing a timestamp of the current date and time. The result string has a format as specified in format-string. The following characters has a special meaning in format-string:

Y year digit;

M month digit;

D day digit;

H hour digit;

N minute digit;

S second digit;

T millisecond digit (always 0).

All the other characters are transcripted literally. You can get the standard timestamp format with the following format-string:



Converts all characters in string to lower case. LCASE and LOWER are synonyms.


Returns the length of string.

LOCATE(string-1, string-2, num-expr)

Returns the character offset (base 1) into the string string-1 of the first occurrence of the string string-2, starting the search at the offset num-expr. If the string is not found, 0 is returned.


Returns string with leading blanks removed.


Returns string with trailing blanks removed.

SPACE( num-expr)

Returns a string num-expr blank characters long.

SUBSTRING(string, num-expr-1, num-expr-2)

Returns the substring of string starting at the given num-expr-1 start position (origin 1) and num-expr-2 characters long.


Converts all characters in string to upper case. UCASE and UPPER are synonyms.

Index Previous Next