Hitachi

Hitachi Advanced Database Command Reference


17.9.1 How to handle logical errors in input data

Figure 17‒18: Procedure for handling logical errors in input data shows the procedure for handling logical errors in input data. This procedure assumes that logical error data is output to a logical error data file.

If you are using input data files compressed in GZIP format, input data means decompressed data.

Figure 17‒18: Procedure for handling logical errors in input data

[Figure]

The following subsections explain each step.

Organization of this subsection

(1) Saving the logical error data file

Save the logical error data file.

(2) Checking the logical error data messages

The KFAA50217-E through KFAA50224-E messages and the KFAA52100-E message concern logical error data. Check if any of these messages have been issued.

(3) Correcting the logical error data

The output pattern for the logical error data file differs depending on the combination of the following three factors:

The following describes output patterns for the logical error data file:

The following describes the handling method for each of these cases.

(a) When row data containing logical errors is output without any processing

Open the logical error data file that was saved in (1) Saving the logical error data file, and then correct the logical error data.

The order of the rows containing the logical error data corresponds to the order in which the messages checked in (2) Checking the logical error data messages were output. Check the messages and correct the data directly in the logical error data file.

Example of output message

KFAA50217-E  The input data length is invalid.
             (input file = 1, row = 1, column = 2)                   ...1
 
KFAA50222-E  The input data contains an invalid empty string.
             (input file = 1, row = 2, column = 3)                   ...2
 
     :
Explanation:
  1. The KFAA50217-E message is issued when a data length is invalid.

    input file = 1 ,row = 1, column = 2 indicates the location in the input data file of the data resulting in the logical error. In this example, the logical error occurred in the data located in row 1, column 2 of the first input data file (input file) specified in the input data path file.

  2. The KFAA50222-E message is issued when data in a column with the NOT NULL constraint contains the empty string.

Content of the logical error data file (when the row data is output without any processing)

[Figure]

(b) When only data that was destined for storage in the table to be processed is extracted

The handling method differs depending on whether the logical error data is field data that was destined for storage in the table to be processed.

  • If field data that was destined for storage in the table to be processed caused a logical error:

    The field data that caused an error is output to the logical error data file.

    In this case, open the logical error data file that was saved as explained in (1) Saving the logical error data file, and correct the logical error data.

    The order of the rows containing the logical error data corresponds to the order in which the messages checked in (2) Checking the logical error data messages were output. Check the messages and correct the data directly in the logical error data file.

  • If field data that was not destined for storage in the table to be processed caused a logical error:

    The field data that caused an error is not output to the logical error data file.

    In this case, see the message you checked in (2) Checking the logical error data messages, and identify the cause of the error in the input data file.

    After the corresponding row data in the input data file is checked, if the content that was output to the logical error data file shows no problem, there is no need to correct that file. If the content that was output to the logical error data file shows a problem, extract the applicable row data from the input data file and correct it.

The message that is output is the same as when row data containing logical errors is output without any processing. For a message example, see (a) When row data containing logical errors is output without any processing.

Content of the logical error data file (when only data that was destined for storage is extracted)

[Figure]

Note

When only data that was destined for storage is extracted to the logical error data file, delimiters are extracted to the logical error data file so that the number of input data files matches the number of field data items. (Therefore, when you re-execute the adbimport command, you can use the corrected logical error data file as the input data file without changing the options.)

The (largest field data number that did not become target for storage in table to be processed + 1)th and subsequent delimiters are not extracted.

(4) Re-executing the adbimport command

Re-execute the adbimport command to import the corrected data. Specify the file containing the corrected data (logical error data file) as the input file and then re-execute the adbimport command.

If there was no need to correct the logical error data file, use the logical error data file that is output directly as the input data file. If you extracted row data from the input data file and corrected it, use the file in which you stored the extracted and corrected row data as the input data file.

Important

Make sure that you execute the adbimport command in addition mode (-d option omitted). If you execute the adbimport command in creation mode, the correct data that has already been imported will be deleted.

As a general rule, do not change any options other than the -d option. Also, do not change the import options.