Converting Data On Insertion - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Converting data on insertion

213
NULL
24
NULL
(2 rows affected)
ps_partkey
ps_suppkey
----------
----------
213
NULL
24
NULL
28
NULL
211
NULL
(4 rows affected)
Previewing partial-
width inserts
Converting data on insertion
202
190
215
If you later load data from another file into
insertions begin correctly at the next row, as shown below.
LOAD TABLE partsupp
(ps_partkey ASCII(6),
ps_availqty ASCII(6),
FILLER(2))
FROM 'C:\\iq\\archive\\mill2.txt'
SELECT *, rowid(partsupp) FROM partsupp
ps_availqty
-----------
190
215
490
15
To calculate and insert the values for
statement shown earlier in this example, changing the
the new row number, 3.
Given the possibility of errors if you do a partial-width insert incorrectly, it is
a good idea to preview these inserts. The
the layout of input in the destination table. This option is available in
, but not in the
TABLE
INSERT
The data you enter into your Adaptive Server IQ database will likely come
from diverse sources. Not all of your data will match the Adaptive Server IQ
data types exactly. Some of it will need to be converted. Data is converted in
two ways: explicitly and implicitly. For example, to insert
column you must convert it explicitly.
INT
Implicit conversions can occur:
When you insert data selected from another column in the same database
152.00
1
172.00
2
ps_partkey
ps_value
rowid(partsupp)
--------
---------------
152.00
1
172.00
2
NULL
3
NULL
4
, you need to repeat the
ps_value
START ROW ID
load option lets you see
PREVIEW
command.
and
,
ps_availqty
INSERT
value to
LOAD
data into an
CHAR

Advertisement

Table of Contents
loading

Table of Contents