All LONG Values to Be Inserted in One Data File 

When you load LONG values, you must differentiate between the following cases:

Case 2: All of the LONG values to be inserted for a column are in one file.

Variant 1

In the source file, you specify the name of the file containing the LONG values with the start and end position of the LONG value to be loaded, instead of a column value.

DATALOAD TABLE hotel
   cno      1
   name     2
   info     3
INFILE 'hotel.data'

Contents of the source file:

10,Excelsior,'HOTEL.LNG' 1-880
30,Flora,'HOTEL.LNG' 881-1046
60,Bellevue,'HOTEL.LNG' 1047-1360

Variant 2

You specify the name of the file containing the LONG values in the command after the keyword LONGFILE and not before the positions specified in the source file.

DATALOAD TABLE hotel
   cno     1
   name    2
   info    3
INFILE 'hotel.data'
LONGFILE info 'HOTEL.LNG'

Contents of the source file:

10,Excelsior,1-880
30,Flora,881-1046
60,Bellevue,1047-1360

Specification of a code attribute for the files specified with LONGFILE (variant 2)

In the load command, it is possible to specify the code attribute for files specified with LONGFILE. This is an optional entry.

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
LONG BYTE
LONG UNICODE

yes
yes
yes

UCS2

LONG ASCII
LONG BYTE
LONG UNICODE

no
yes
yes

BINARY

LONG ASCII
LONG BYTE
LONG UNICODE

no
no
yes

 

Specification of ASCII code attribute ASCII

DATALOAD TABLE hotel
   cno      1
   name     2
   info     3
INFILE 'hotel.data'
LONGFILE info 'HOTEL.LNG' ASCII

Contents of the source file:

10,Excelsior,1-880
30,Flora,881-1046
60,Bellevue,1047-1360