DB2 graphic  QMF Version 8

Working with single data values using SQL scalar functions

You can use scalar functions to:

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 75 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.


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004