Converting data on insertion

You can use a synonym interchangeably with its standard data type. Data is stored internally as the standard data type, where synonyms exist. In error messages, the standard name appears in place of the synonym.

Note By default, Adaptive Server IQ assumes that input data is binary (numeric data) and tries to insert it that way. However, this presumes that the input column length in bytes must match the destination column length in bytes. If not, the insert will fail or lead to unexpected results. For example, if you attempt to insert an input column with integer data of 4 bytes into a SMALLINT destination column, Adaptive Sever IQ loads only the first 2 bytes of that input column.

Inserting data from pre-Version 12 Adaptive Server IQ

If you are moving data into Adaptive Server IQ Version 12 from an earlier version, you must convert certain data types before inserting or loading them. For details, see “Migrating Data from Previous Versions” in the Adaptive Server IQ Installation and Configuration Guide.

Load conversion options

The following table lists the conversion options for the LOAD TABLE statement in alphabetical order and gives a brief description of what each option does. For a detailed description of each option, see the sections that follow. To use these options in the LOAD TABLE statement, see “Specifying load options”.

 

Table 5-5: Conversion options for loading from flat files

 

Adaptive Server IQ

 

 

 

Option

Datatypes

Action

 

 

 

ASCII

TINYINT, SMALLINT, INT (or

By default, Adaptive Server IQ assumes input data is binary of

 

INTEGER), UNSIGNED INT,

appropriate width for the datatype. Using ASCII allows you to tell

 

BIGINT, UNSIGNED BIGINT,

Adaptive Server IQ that data is in character format and lets you

 

NUMERIC (or DECIMAL),

specify how wide it is. This option allows E notation for REAL

 

REAL, DOUBLE, BIT, DATE,

data, but it can hinder your performance.

 

TIME, TIMESTAMP (or

 

 

DATETIME)

 

 

 

 

204

Page 224
Image 224
Sybase 12.4.2 manual Inserting data from pre-Version 12 Adaptive Server IQ, Load conversion options, 204