The following CSPro logic functions are available for use in SQL queries:
| Logic Function Name | SQLite Function Name |
| timestring | cspro_timestring |
For example, this SQL query would return a formatted string containing the date and time of the
first CSPro release using the
timestring logic function:
SELECT cspro_timestring("%c", 957528000);
When defining a
user-defined function, adding the directive
sql after the
function keyword indicates that the SQL query can call back into CSPro logic. These functions can accept
numeric or
string arguments as part of the query, and can return values of those types.
For example, this function is marked with
sql:
This function can then be called as part of a SQL query:
-- result: The sum of 12.1 and 4.2 is 16.3.
SELECT SumNumbers(12.1, 4.2);