Each LONG Value to Be Inserted in a Separate LONG Data File
When you
load LONG values, you must differentiate between the following cases:Case 1: Each LONG value to be inserted for a column is in a separate LONG data file
You specify the names of the files that contain the LONG values in the
source file instead of the column values (if necessary entering position specifications). The entire files or parts of them are loaded as LONG values.Entire files are loaded as LONG values.
DATALOAD TABLE hotel
cno 1
name 2
info 3
INFILE 'hotel.data'
Contents of the
source table:10,Excelsior,'EXCELSIOR.LNG'
30,Flora,'FLORA.LNG'
60,Bellevue,'BELLEVUE.LNG'
Parts of the files are loaded as LONG values.
DATALOAD TABLE hotel
cno 1
name 2
info 3
INFILE 'hotel.data'
Contents of the source table:
10,Excelsior,'EXCELSIOR.LNG' 1-880
30,Flora,'FLORA.LNG' 8-1046
60,Bellevue,'BELLEVUE.LNG' 100-260
Specifying a Code Attribute
In the load command, it is possible to specify a code attribute for all files that contain the LONG values that are to be loaded into a column. This is an optional entry. You can only enter a single code type for all files. It is not possible to specify the code type for each individual file.
If the code attribute is not specified in the command, the Replication Manager uses a default value for the code type of the file. This is derived from the data type of the column to be loaded. The following conversion table is used:
Data type in the database |
External code type |
LONG ASCII |
ASCII |
LONG BYTE |
BINARY |
LONG UNICODE |
UCS2 |
If the external code type and the internal database data type are different, the Replication Manager converts the data. If the types are incompatible, the Replication Manager generates an error message and stops processing the command.
Compatibility table
External code type |
Data type in the database |
Compatible yes/no |
ASCII |
LONG ASCII |
yes |
UCS2 |
LONG ASCII |
no |
BINARY |
LONG ASCII |
no |
Specification of ASCII code attribute ASCII
DATALOAD TABLE hotel
cno 1
name 2
info 3
INFILE 'hotel.daten'
LONGFILE info ASCII
Contents of the
source table:10,Excelsior,'EXCELSIOR.LNG'
30,Flora,'FLORA.LNG'
60,Bellevue,'BELLEVUE.LNG'
No file name can be used after the keyword LONGFILE.