DB2 graphic QMF Version 8

Available expressions

The following are a few examples of the SQL expressions that are available in the Expression Builder.

Note:
The SQL Reference publication for your database type and version is the authoritative source for the syntax of SQL expressions. Refer to this documentation for more information about how to code SQL.

Table 76. SQL Expressions
SQL Expression Description
+ Insert a template for adding two expression elements
- Insert a template for subtracting two expression elements
* Insert a template for multiplying two expression elements
/ Insert a template for dividing two expression elements
CONCAT Insert a template for concatenating two string expression elements
() Group together different parts of an expression
constant>> Display a submenu of constants to insert, such as:
  • Integer
  • Decimal
  • Floating point
  • Character
  • Graphic
column name>> Display a list of all columns in all tables referred to by the current query

Select one or more of the columns and press Enter to insert the selected names into the expression.

special register>> Display a submenu of SQL special registers to insert, such as:
  • CURRENT DATE
  • CURRENT TIME
  • CURRENT TIMESTAMP
  • CURRENT SQLID
  • USER
function>> Display a tree view containing SQL column and scalar functions. The functions are organized into related groups, and each group is displayed under a different branch of the tree.

To insert a reference to a function in the expression, select the function in the tree and click Enter.

The two branches that display at the top of the tree have a special purpose:

  • Favorite Functions lists the functions that used most frequently.

    Add a function to your favorites by right-clicking on the function and selecting Add to Favorites. Remove a function from your favorites by right-clicking on the function and selecting Remove from Favorites.

  • Recently Used Functions lists the ten functions most recently used.

    Use this feature to enter the same function references repeatedly, in the same expression or in a different expressions.

After you select a function, the display area below the tree view displays the function reference template that will be inserted.

When you right-click on a function and select View Reference from the submenu, a Web browser opens and provides IBM reference documentation for the function.

Note:
This option requires an active Internet connection.
case expression>> Insert an SQL case expression:
  • Simple
    CASE <expression> WHEN <expression> THEN
     <result-expression> ELSE <result-expression> END
  • Searched
    CASE WHEN <search-condition> THEN 
    <result-expression> ELSE <result-expression> END


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