You can organize the Ext Type or Simple LO data in a fixed-format data file in the following ways:
When you designate a field as an Ext Type String or Ext Type Binary data type, you specify that the data will occupy a fixed amount of space, similar to the behavior of a fixed-length Chars data type. With fixed-length data format, you must specify the number of bytes that the field occupies in the record.
Simple LO data or varying-sized Ext Type data that is included as part of a fixed-format data file is called inline data. When Ext Type or Simple LO data is inline, the data-file record has two parts: a fixed-length part and a variable-length part. For example, a record with two fields and a Simple LO might be organized as Figure 61 shows.
field1 Simple LO length field1 Simple LO data
The data-type length of the Ext Type or Simple LO data is included in the fixed-length part of the record. The actual TEXT data is inserted at the end of the fixed-length part of the record. The HPL reads the Ext Type or Simple LO length from the fixed-length part of the record and uses that length to read the actual Ext Type or Simple LO data. The HPL also uses the Ext Type or Simple LO length to calculate the offset to the beginning of the next record.
Figure 62 shows the format definition of a record with inline Ext Type or Simple LO data. The arrows show how the HPL puts the record into the database. The arrows from field 1 and field 2 indicate entries in fixed-length format. The split arrow shows that the HPL uses the Simple LO length information to find the Simple LO data and insert it into the table. The HPL does not insert the Simple LO length into the database.
When you define the format in the format-definition window, select the appropriate data-type length data type (Ext Type String Length, Ext Type Binary Length, or Simple LO Length) for the data-type length field. Figure 63 shows the format for the example in Figure 61. The format does not include an entry for Simple LO data.
When you create a map to link the input fields that are defined by the format to the columns of a database table (see Defining Maps), connect the data type length input field to the table column that contains that particular data. In this case, connect the Simple LO length input field to the table column that contains the Simple LO data.
You can also store Simple LO data in separate files. During a load, Simple LO data files are read and inserted into the database. During an unload, the file is created and BYTE and TEXT data is written to the file. When the fixed-format input contains the pathname of a data file, the HPL uses that pathname to insert data into a column of the database table, as Figure 64 shows. When you prepare the format, select Blob File for the data type.
When you create a map to link the fields of the input record to the columns of a database table (see Defining Maps), link the name of the Simple LO file with the Simple LO column. The arrows in Figure 64 illustrate how the HPL inserts the Simple LO data into the column.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]