Sybase 12.4.2 manual Specifying the format for Datetime conversions, 213

Models: 12.4.2

1 536
Download 536 pages 20.34 Kb
Page 233
Image 233

CHAPTER 5 Moving Data In and Out of Databases

l_quantity ASCII(4),

l_shipdate DATETIME(’MM/DD/YY hh:mm:ss’), FILLER(1))

FROM ’/d1/MILL1/tt.t’ BLOCK FACTOR 1000 PREVIEW ON

In this UNIX example, the FILLER(1) clause prevents Adaptive Server IQ from inserting a NULL in the next column (VWAP) after the DATETIME column:

LOAD TABLE snapquote_stats_base SYMBOL ‘\x09’,

snaptime DATETIME('MM/DD/YY hh:mm:ss'), FILLER(1))

VWAP ‘\x09’, RS_DAY ‘\x09’,

FROM '/d1/MILL1/tt.t' BLOCK FACTOR 1000 PREVIEW ON

In this UNIX example, the destination columns contain TIME data, but the input data is DATETIME. You use the TIME conversion option, and use FILLER to skip over the date portion.

LOAD TABLE customer( open_time TIME('hh:mmaa'), close_time TIME('hh:mmaa'),

FILLER(9))

FROM '/d1/MILL1/tt.t' BLOCK FACTOR 1000 PREVIEW ON

Specifying the format for DATETIME conversions

Specify the format of the DATETIME input data using:

Y or y for years

M or m for months

D or d for days

H or h to indicate hours

N or n to indicate minutes (mm is also accepted when colons are used as separators

S or s to indicate seconds and fraction of a second

213

Page 233
Image 233
Sybase 12.4.2 manual Specifying the format for Datetime conversions, 213