Column Width Issues; Using The Ascii Conversion Option - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Converting data on insertion

Column width issues

Using the ASCII conversion option

208
Adaptive Server IQ assumes the width of the input data is the same as the
destination column width and reads the input file accordingly. If they are not
the same width, Adaptive Server IQ may read too few or too many bytes of the
input file for that column. The result is that the read for that column may be
incorrect, and the reads for subsequent columns in the input file will be
incorrect, because they will not start at the correct position in the input file.
For example, if
input_column1
bytes wide, and you do not specify the
Server IQ assumes the input column is only 10 bytes wide. This is fine for
, because the input data is truncated to 10 bytes in any case.
destination_column1
But it also means that Adaptive Server IQ assumes that the next column in the
input file starts at byte 11, which is still in the middle of the first column,
instead of at byte 16, which is the correct starting position of the next column.
Conversely, if
input_column1
bytes wide, and you do not specify the
Server IQ assumes the input column is 15 bytes wide. This means that
Adaptive Server IQ reads all of
in the input file and inserts this value into
inserts into
destination_column1
To prevent such problems, use the
Adaptive Server IQ provides several ways to specify the fixed or variable
width of an input column. Your input data can contain fixed width input
columns with a specific size in bytes, variable width input columns with
column delimiters, and variable width input columns defined by binary prefix
bytes.
Use the
conversion option to either:
ASCII
Convert ASCII input data to binary and specify the width of the input
column so data can be read in correctly for that column, or
Insert ASCII data into an
input column is different from the width of the destination column. This
option lets you specify how much of the input data it should read for each
column.
You can use this option with any of the Adaptive Server IQ data types, with 1,
2, or 4 prefix bytes, and with a column delimiter.
is 15 bytes wide and
destination_column1
conversion option, Adaptive
ASCII
is 10 bytes wide and
destination_column1
conversion option, Adaptive
ASCII
plus 5 bytes into the next column
input_column1
destination_column1
and all subsequent columns are incorrect.
conversion option. With this option,
ASCII
data type column when the width of the
ASCII
is 10
is 15
. So, the value

Advertisement

Table of Contents
loading

Table of Contents