Sybase 12.4.2 manual Handling conversion errors on data import, 220, DATE/TIME data types

Models: 12.4.2

1 536
Download 536 pages 20.34 Kb
Page 240
Image 240

Matching Adaptive Server Enterprise data types

 

 

Table 5-15: DATE/TIME data types

Adaptive Server

 

Adaptive Server

 

 

 

Enterprise Datatype

 

IQ Datatype

Notes

 

 

 

 

datetime

 

TIMESTAMP or

Adaptive Server Enterprise datetime columns maintain date and

 

 

DATE or TIME

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

 

TIMESTAMPor

Define Adaptive Server Enterprise smalldatetime columns as

 

 

DATETIME or

TIMESTAMP (or DATETIME) datatype in Adaptive Server IQ.

 

 

DATE or TIME

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.

 

 

 

 

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.

220

Page 240
Image 240
Sybase 12.4.2 manual Handling conversion errors on data import, 220, DATE/TIME data types