Handling conversion errors on data import – Sybase 12.4.2 User Manual

Page 240

Advertising
background image

Matching Adaptive Server Enterprise data types

220

Table 5-15: DATE/TIME data types

Since the following Adaptive Server Enterprise data types are not supported,
you must omit columns with these data types:

varbinary

image

nchar

This also applies to any custom Adaptive Server Enterprise data type.

Handling conversion errors on data import

When you are loading data from external sources, there may be errors in the
data. For example, there may be dates that are not valid dates and numbers that
are not valid numbers. The

CONVERSION_ERROR

database option allows you

to ignore conversion errors by converting them to NULL values.

Adaptive Server
Enterprise Datatype

Adaptive Server
IQ Datatype

Notes

datetime

TIMESTAMP

or

DATE

or

TIME

Adaptive Server Enterprise

datetime

columns maintain date and

time of day values in 4 bytes for number of days before or after
base date of virtual date 0/0/0000 and 8 bytes for time of day,
accurate to within one 1,000,000th of a second. Adaptive Server
IQ

TIMESTAMP

(or

DATETIME

) columns maintain date and time

of day values in two 4-byte integers: 4 bytes for number of days
since 1/1/0 and 4 bytes for time of day, based on 24-hour clock,
accurate to within one 10,000th of a second. Adaptive Server IQ
automatically handles the conversion.

Adaptive Server IQ also has a separate

DATE

datatype, a single 4-

byte integer. If you want to extract just a date from a SQL Server
or Adaptive Server Enterprise

datetime

column, you can do this

with Adaptive Server IQ

DATE

datatype. To do this, define an

Adaptive Server IQ

DATE

column with same name as the Adaptive

Server Enterprise

datetime

column. Adaptive Server IQ

automatically picks up appropriate portion of

datetime

value.

smalldatetime

TIMESTAMP

or

DATETIME

or

DATE

or

TIME

Define Adaptive Server Enterprise

smalldatetime

columns as

TIMESTAMP

(or

DATETIME

) datatype in Adaptive Server IQ.

Adaptive Server IQ properly handles the conversion. As with
regular

datetime

, if you want to extract just a date from an

Adaptive Server Enterprise

smalldatetime

column, do it with the

Adaptive Server IQ

DATE

datatype.

Advertising