Using QMF


Working with single data values using SQL scalar functions

You can use scalar functions to do the following:

For more information on scalar functions, see the SQL reference manual for your database management system.

Scalar functions produce a single scalar value for each row that satisfies the search condition in your query. For example, if you replace SUM in the SELECT clause of the SQL statement in Figure 72 with the scalar function HEX, five rows are returned--one hexadecimal value for each row satisfying the search condition:

SELECT HEX(SALARY)
  FROM Q.STAFF
  WHERE DEPT = 38

+--------------------------------------------------------------------------------+
|   SALARY                                                                       |
|   --------                                                                     |
|   1750675C                                                                     |
|   1800600C                                                                     |
|   1680830C                                                                     |
|   1295475C                                                                     |
|   1200975C                                                                     |
+--------------------------------------------------------------------------------+

Conversion functions, date/time functions, and string functions are subsets within the set of scalar functions.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]