FLOAT_AS_DOUBLE option [TSQL]

Function

Controls the interpretation of the FLOAT keyword.

Allowed values

ON, OFF

Default

OFF

Description

Turning on the FLOAT_AS_DOUBLE option makes the IQ FLOAT keyword behave like the Adaptive Server Enterprise FLOAT keyword when a precision is not specified.

When set to ON, Sybase IQ interprets all occurrences of the keyword FLOAT as equivalent to the keyword DOUBLE within SQL statements.

NoteWhen using JDBC and Client Library connections, for example, running Sybase Central, you must set the FLOAT_AS_DOUBLE option to ON. If you do not do this, CREATE JOIN INDEX operations fails.

By default, IQ FLOAT values are interpreted by Sybase IQ as REAL values. Since Adaptive Server Enterprise treats its own FLOAT values as DOUBLE, enabling this option makes Sybase IQ to treat FLOAT values in the same way Adaptive Server Enterprise treats FLOAT values.

REAL values are four bytes, DOUBLE values are eight bytes. According to the ANSI SQL92 specification, FLOAT can be interpreted based on the platform. It is up to the database to decide what size it is, so long as it can handle the necessary precision. Adaptive Server Enterprise and Sybase IQ exhibit different default behavior.

NoteIf a join column is a REAL datatype, you must set FLOAT_AS_DOUBLE to OFF when creating join indexes, or an error occurs. Issues might also result when using inexact numerics for join columns.

The FLOAT_AS_DOUBLE option only takes effect when no precision is specified. For example the following statement is not affected by the option setting:

create table t1( 
   c1 float(5)
)

The following statement is affected by the option setting:

create table t2( 
   c1 float)
// affected by option setting