Consultor Eletrônico



Kbase P114743: Errors when loading data after the table structure has been changed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

SYMPTOM(s):

Errors when loading table data

** Invalid character in numeric input <character>. (76)

** Invalid date input. (85)

** Input value: <input> should be <yes
o>. (87)

Loading ASCII table dump

Using IMPORT statement

Data was saved with ASCII dump or EXPORT statement

CHANGE:

Table definition was changed between dump and load

CAUSE:

Data from the dump file is formatted and ordered using original table definition. The IMPORT statement is attempting to load into a field data intended for another field that may have changed types, or been deleted, or renamed (moved), or a new field was added.

FIX:

List explicitly the fields to load with the IMPORT statement, with placeholders for fields that have been deleted since the original dump.
For example:
1. "Customer" table contained initially the fields Cust-num, Address, Name, Gender, Postal-code
2. "Customer" records are dumped into a file "customer.d" using the following code or similar:
OUTPUT TO "customer.d".
FOR EACH Customer:
EXPORT Customer.
END.
OUTPUT CLOSE.
3. Field "Gender" is deleted, and a new field "City" is added.

To load the data back into the Customer table the "Gender" field data must be ignored, and a default value loaded for the City field. Use the following 4GL code:
INPUT FROM "customer.d".
DEFINE VARIABLE GenderPlaceholder AS CHARACTER NO-UNDO.
REPEAT:
CREATE Customer.
IMPORT Cust-num Adress Name GenderPlaceholder Postal-code.
ASSIGN Customer.City = ?.
END.
INPUT CLOSE.