Problem in loading .d File

skunal

Member
Hi,

I have to load the .d file which has 3 fields. The first field contains the sequence which should automatically insert the record as it creates. So i have the .d file with two values. Ex: Table structure contains customer_id name city , Where customer_id has sequence . SO i have .d file with name and city values. When i am loading the data its not considering sequence customer_id gets loaded with 0. Can anyone please suggest is there anything i have to conisder while loading data or is my .d file wrong.

Thanks.
 

StuartT

Member
It has been a while since i did any dictionary loads, but i thought that to do a load throught the dictionary that the .d file had to have the same amount of entries as there are fields in the table.

Anyway, the best way to handle this (I am assuming you have a fairly recent version of progress) is as follows:
define temp-table tt-loader like <table>.

input from <wherever the .d file is>.
repeat:
import tt-loader.
create <table>.
buffer-copy tt-loader except customer_id to <table>.
assign <table>.customer_id = next-value(<sequence name>).
end.
input close.
 

RealHeavyDude

Well-Known Member
During an ASCII load with the data administration tool the triggers on the database tables get disabled automatically. Whatever logic that would be in your triggers to populate something will not fire. This way of loading the data into the database only works when you generated the dump file with the same tool in the first place and the schema of the table before and after match exactly. Of course, it's possible to generate such a file by your own program (which is what I think you have) - but then you need to know exactly what you're doing.

The issue you have is, that the field which holds the sequence values is not present in your .d file. Therefore you can only have you own logic programmed to cope with this which would be able to load the data.

Is there any particular reason why this sequence field is not part of the dump?

Regards, RealHeavyDude.
 
Top