PersonalDB - Additional SQL Functions

Other functions besides those listed on this page are available, and they are listed on the SQLite website.

Note that parameters to SQL functions are typeless.

isinteger

Summary: This function is used to determine if a string represents an integral value.

Parameters: One, the string to be checked. For the function to return true, the string must consist entirely of characters in the range '0'-'9'. The only exception is the leading character, which may also be one of the characters '+' and '-'.

Return: Boolean

isintegerdate

Summary: This function is used to determine if a string represents an integral value, and if that integral value represents a bit-field encoded date.

Parameters: One, the string to be checked. It must represent an integer under the same restrictions as checked by isinteger. When the parameter is converted to a 32-bit integer, the integer must have the following format:

BitsValue
0-4The date's date. Must be between 1 and 31, inclusive.
5-8The date's month. Must be between 1 and 12, inclusive.
9-31The date's year.

Return: Boolean

isintegerrange

Summary: This function is used to determine if a string represents an integral value, and if that integral value is within a specified range.

Parameters: This function takes three parameters. The first parameter is the string to be checked. It must have the same format as checked by the function isinteger. Further, when converted to an integer, that integer must be within the specified bounds for the function to return true.

The second and third represent the lower and upper bounds. Either of the bounds can be null, in which case that bound will not be checked.

Return: Boolean

isintegertime

Summary: This function is used to determine if a string represents an integral value, and if that integral value represents a bit-field encoded time.

Parameters: It must represent an integer under the same restrictions as checked by isinteger. When the parameter is converted to a 32-bit integer, the integer must have the following format:

BitsValue
0-7The number of seconds in the time. Must be between 0 and 59, inclusive.
8-15The number of minutes in the time. Must be between 0 and 59, inclusive.
16-23The number of hours in the time. Must be between 0 and 23, inclusive.
24-31Must be equal to one.

Return: Boolean

shortstring

Summary: The purpose of this function is to create a truncated user-friendly version of a long string. For example, to show only the start of a long block of text.

Parameters The first parameter is the string to be truncated, and the second parameters it the maximum length of the returned string.

Return:A string with no more than the specified number of characters. If a return character is found earlier, then this will be used to limit the string length.

timestamp

Summary: Create an integer value representing the current time.

Parameters: None

Return: An integer with the same semantics as a time_t variable from the 'C' standard library.

SourceForge.net Logo Valid XHTML 1.0! Valid CSS!
Webmaster: Robert W. Johnstone