Reviews
WebSphere TutorialsTable of Contents
WebSphere V5.0 : Building Expressions
WebSphere V5.0 : Building Expressions - Page 2WebSphere V5.0 : Building Expressions Page - 2
WebSphere V5.0 : Building Expressions
CASE - Search or Simple type
CASE expressions allow an expression to be selected based on the evaluation of one or more conditions. A CASE expression contains one or more when clauses of either Search or Simple type. A Search type CASE expression has no expression following the CASE keyword and each of its when clauses is a condition that is evaluated such as i<8. A Simple type CASE expression has an expression following the CASE keyword. The expression is compared with the expression following each when clause. The value of the case-expression is the value of the result-expression following the first when clause in the case-expression that evaluates to true. If a when clause does not evaluate to true, the else clause determines the value of the case-expression.
Cast function
A function used to convert instances of a data type (origin) into instances of a different data type (target). A cast function takes the following form CAST(expr AS datatype). The result of the expression expr is converted to the type datatype. For example, CAST (XMLTEST.EMPLOYEE.SALARY AS INTEGER) converts the values in the column SALARY to type integer.
Constant
A constant specifies a value. A constant can be a string or a number. Numeric constants can be an integer, floating-point, or decimal. A string constant can be a character string constant, a hexadecimal constant or a host variable name. A host variable name is denoted by a name preceded by a colon such as :var and it is replaced by a value when the statement is executed.

Subquery
A subquery is a SELECT, WITH, or FULLSELECT statement nested within another SQL statement. The expression value is the result of the subquery.
Build up expressions by operators
An expression can be built by applying operators to columns or expressions such as x + y where x is a column and y is an expression.
Using host variables in an SQL statement
Host variables can be used in an SQL statement to represent a value that will be substituted in at execution time. The host variable syntax is a symbol followed by a string. For example, :companyname. The symbol used depends on the what syntax your database vendor uses to denote variables.
- For Sybase, SQLServer and MySQL, you would use @NAME where NAME is the name of the host variable.
. - For all others database vendors, you would use :NAME where NAME is the name of the host variable.

You can use a host variable in your SQL statement in place of an expression. The Expression Builder can be used to create a host variable or you can simply type a host variable in place of an expression in the SQL query builder views.
When you execute your statement in the SQL builder you will be prompted to substitute a value of the appropriate type for the host variable.
_________________
Author: Mikalai Zaikin. Please Click Here to visit Authors site for any updates and changes to the study notes.
WebSphere Tutorials
- WebSphere V5.0 : Building Expressions
- WebSphere V5.0 : Creating SQL statements
- WebSphere V5.0 : Applying DDL scripts to a remote database
- WebSphere V5.0 : Deploying to the database
- WebSphere V5.0 : Defining a table
- WebSphere V5.0 : Defining a database
- Working with Data in WebSphere
- WebSphere V5.0 : Debugging - JSP debugging
- WebSphere V5.0 : Debugging - Scrapbook Page
- WebSphere V5.0 : Debugging - View variables
- WebSphere V5.0 : Debugging - Step-through code
- WebSphere V5.0 : Debugging - Set breakpoints
- WebSphere V5.0 : Running Applications - Export J2EE applications
- WebSphere V5.0 : Running Applications - Run/operate server
- WebSphere V5.0 : Running Applications - Understand Session Manager
- WebSphere V5.0 : Running Applications - Configure data sources
- WebSphere V5.0 : Running Applications - Create server instance and server configuration
- WebSphere V5.0 : Web Development - Use Web Page Wizards
- WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
- WebSphere V5.0 : Web Development - Use content assist
- WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
- WebSphere V5.0 : Web Development - Understand classpath and module dependencies
- WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
- WebSphere V5.0 : Web Development - Create a web project
- WebSphere V5.0 : Java Development - Use property dialogues
- WebSphere V5.0 : Java Development - Use hierarchy view
- WebSphere V5.0 : Java Development - Use task view
- WebSphere V5.0 : Java Development - Use search function
- WebSphere V5.0 : Java Development - Use content assist function and declarations
- WebSphere V5.0 : Java Development - Use refactoring features
- WebSphere V5.0 : Java Development - Use Outline View and Browsing View
- WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
- WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
- WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
- WebSphere V5.0 : Workbench Basics - Work with Perspectives
- WebSphere V5.0 : Workbench Basics - Set workbench preferences
- WebSphere V5.0 : Workbench Basics - Create J2EE projects







