This is an old revision of the document!


DRAFT

Omnidex SQL Function: CASE

Description

The CAST function converts expressions to a specified data type. Column formatting will be the default for the specified data type.

Due to conflicts in specifications, the main OmniAccess data types are not supported here. The $CONVERT function should be used for OmniAccess data types and for more specific functions.

Syntax

CAST(scalar_expression AS datatype[(n)])
scalar_expression

Required. The column name that is to be cast.

AS

Required

datatype

Required. The supported SQL92 data type.

n

Length if applicable.

Examples

Example 1

SELECT amount, 
   CAST(orders.amount AS DOUBLE PRECISION)
   FROM orders WHERE STATUS='cncl';

Example 2

SELECT order_date,
   CAST(SUBSTRING(order_date FROM 1 FOR 2) AS INTEGER)
   FROM orders 
   WHERE STATUS='back';
 
Back to top
dev/sql/functions/cast.1278209957.txt.gz ยท Last modified: 2016/06/28 22:38 (external edit)