In addition to supporting all functions supported by the back-end database, WinSQL Professional also supports ODBC scalar functions. In most cases, you will not need to use scalar functions since the back-end database usually has a richer set. However, in some cases, for instance when the source is a text file, you will find these functions extremely helpful.
Following are the types of scalar functions:
·String functions
·Numeric functions
·Time and date functions
·System functions
The syntax for using scalar functions is as follows:
{fn FUNCTION_NAME( PARAMETERS ) }
The string {fn MUST precede the function name and a } must be followed after the close parenthesis. For example:
select {fn SUBSTRING(first_name, 1, 3)} FirstThree, first_Name
from customers
where cust_id = 1049
This query displays the following result:
FirstThree first_Name
---------- -------------------------
Den Denzil
1 Row(s) affected
The FirstThree field only displays the first 3 characters of the name.
Important note: Your driver may not support all of the functions listed below. Check the driver help file for a detailed listing of supported functions.