case

Description

Supports conditional SQL expressions; can be used anywhere a value expression can be used.

Syntax

case
	when search_condition then expression
	[when search_condition then expression]...
	[else expression]
end

Usage

Usage


Server Class ASEnterprise

The capability for handling case expressions is set for ASE 11.5 and all later versions. The presence of a case expression in the original query syntax will not cause the query optimizer to reject quickpass mode.


Server Class ASAnywhere

The capability for handling case expressions is set for ASA 6.0, ASIQ 12.0, and all later versions. The presence of a case expression in the original query syntax will not cause the query optimizer to reject quickpass mode.


Server Class ASIQ


Server Class sql_server


Server Class direct_connect

The capability for handling case expressions is determined by the result set from the RPC sp_capabilities. If the direct_connect indicates that it can handle case expressions, then CIS will forward them to the direct_connect when quickpass mode is used to handle the query.


Server Class db2

The capability for handling case expressions is, by default, not set for servers in this class. When a SQL statement containing a case expression is optimized, the presence of the case expression will cause CIS quickpass optimization to reject the statement. When this happens, the case expression must be evaluated by the local ASE after retrieving data from the remote server.