Alphabetical list of functions
318
♦
SQL/92 Vendor extension.
♦
Sybase Not supported in Adaptive Server Enterprise.
"SUBSTRING function" on page 369
CAST function [Data type conversion]
Returns the value of an expression converted to a supplied data type.
CAST (
expression
AS
data type
)
expression The expression to be converted.
data type The target data type.
The following function ensures a string is used as a date:
CAST( ’2000-10-31’ AS DATE )
The value of the expression 1 + 2 is calculated, and the result cast into a
single-character string.
CAST( 1 + 2 AS CHAR )
You can use the CAST function to shorten strings:
CAST( Surname AS CHAR(10) )
If you do not indicate a length for character string types, the database server
chooses an appropriate length. If neither precision nor scale is specified for a
DECIMAL conversion, the database server selects appropriate values.
♦
SQL/92 This function is SQL/92 compatible.
♦
Sybase Not supported in Adaptive Server Enterprise.
"CONVERT function" on page 322
CEILING function [Numeric]
Returns the ceiling (smallest integer not less than) of a number.
CEILING (
numeric-expression
)
numeric expression The number whose ceiling is to be calculated.
The following statement returns the value 60.
SELECT CEILING( 59.84567 )
Standards and
compatibility
See also
Function
Syntax
Parameters
Examples
Usage
Standards and
compatibility
See also
Function
Syntax
Parameters
Examples