PDA

View Full Version : Data import 2.3b



Roland Wingerter
23-Mar-2006, 04:41 AM
I am trying to import data into an existing table (version 2.3b). The source
file has an identical structure and I created and compiled a program using
the read.flx utility.

However, when I run the resulting program, for each record I get an Error
message "Duplicate records not allowed". This puzzles me, as the new records
are definitely no duplicates. What am I missing?

Please see generated code and table definition below my signature. Note that
the last field is an OVERLAP field. I am not sure wether this should be in
the text file or not. I tried different things, but no luck.

Thanks for any help you can offer.

Roland


/*
clearscreen

string temstr
number recs

direct_input "RD_IXD.TXT"
[seqeof] error 75 "RD_IXD.TXT"
[seqeof] abort

open IXD

repeat
read IXD.WORT
read IXD.DESTYP
read IXD.WST
read IXD.ZGR
read IXD.MERK003
read IXD.FAC
read IXD.SGR
read IXD.SPRA
read IXD.WOA
read IXD.GRM
read IXD.BRP
read IXD.BRA
read IXD.AKZ
read IXD.MERKER
read IXD.EDATUM
read IXD.ADATUM
read IXD.USERNR
read IXD.STATUS
read IXD.FRGB
read IXD.GTNG
read IXD.HOMO
read IXD.ANFANG
readln

[not seqeof] begin
saverecord IXD
clear IXD
show "*"
calc (recs + 1) to recs
end

keycheck begin // Eine Taste wurde gedrckt.
showln // Programm beenden ?
showln "Eine Taste wurde gedrckt, " recs " Datens"tze
gelesen"
show "<ESC> = Ende, beliebige Taste fr WEITER ... "
inkey temstr
[key.escape] abort
showln
showln
end

until [seqeof]


showln
showln recs " Datens"tze eingelesen in IXD."
show "Beliebige Taste fr WEITER ... "
inkey temstr
abort



DATENBANK DEFINITIONEN - Datei-Nr: 5
************************************************** ***
System-Name = ixd
Benutzer-Name = ixd
DataFlex-Name = IXD
************************************************** ***
Datensatzl"nge = 85 (benutzt = 83)
Max. Zahl der S"tze = 16000000 (benutzt = 59142)
Freier Platz wird wiederverwendet
Multi-User RE-READ aktiv
************************************************** ***
FELD FELD FELD FELD DEZ HAUPT VERKNsPFUNG
NUMMER OFFSET LZNGE TYP STE INDEX DATEI FELD
------ ------ ----- ------ --- ----- ----- -----
1 1 50 ASCII 1 0 0 WORT
2 51 1 ASCII 0 0 0 DESTYP
3 52 1 ASCII 0 0 0 WST
4 53 1 ASCII 0 0 0 ZGR
5 54 1 ASCII 0 0 0 MERK003
6 55 1 ASCII 3 0 0 FAC
7 56 3 ASCII 4 0 0 SGR
8 59 2 ASCII 1 0 0 SPRA
9 61 2 ASCII 0 0 0 WOA
10 63 2 ASCII 0 0 0 GRM
11 65 3 ASCII 0 0 0 BRP
12 68 2 ASCII 0 0 0 BRA
13 70 1 ASCII 0 0 0 AKZ
14 71 1 ASCII 2 0 0 MERKER
15 72 3 DATE 0 0 0 EDATUM
16 75 3 DATE 0 0 0 ADATUM
17 78 2 NUMERIC 0 0 0 0 USERNR
18 80 1 ASCII 0 0 0 STATUS
19 81 1 ASCII 0 0 0 FRGB
20 82 1 ASCII 0 0 0 GTNG
21 83 1 NUMERIC 0 1 0 0 HOMO
22 1 5 OVERLAP 1 0 0 ANFANG

Index 1: Feldsegmente: <8> <1> <21>
Index 2: Feldsegmente: <14> <22> <0>
Index 3: Feldsegmente: <8> <6> <22> <0>
Index 4: Feldsegmente: <8> <7> <22> <0>

DavePorter
23-Mar-2006, 05:07 AM
Hi Roland,

Index #1 is a unique index ( i.e. no recnum in any of the segments ).
So I'm guessing the imported data has records that match existing data
for these 3 fields ?

cheers, Dave Porter

Roland Wingerter wrote:
> I am trying to import data into an existing table (version 2.3b). The source
> file has an identical structure and I created and compiled a program using
> the read.flx utility.
>
> However, when I run the resulting program, for each record I get an Error
> message "Duplicate records not allowed". This puzzles me, as the new records
> are definitely no duplicates. What am I missing?
>
> Please see generated code and table definition below my signature. Note that
> the last field is an OVERLAP field. I am not sure wether this should be in
> the text file or not. I tried different things, but no luck.
>
> Thanks for any help you can offer.
>
> Roland
>
>
> /*
> clearscreen
>
> string temstr
> number recs
>
> direct_input "RD_IXD.TXT"
> [seqeof] error 75 "RD_IXD.TXT"
> [seqeof] abort
>
> open IXD
>
> repeat
> read IXD.WORT
> read IXD.DESTYP
> read IXD.WST
> read IXD.ZGR
> read IXD.MERK003
> read IXD.FAC
> read IXD.SGR
> read IXD.SPRA
> read IXD.WOA
> read IXD.GRM
> read IXD.BRP
> read IXD.BRA
> read IXD.AKZ
> read IXD.MERKER
> read IXD.EDATUM
> read IXD.ADATUM
> read IXD.USERNR
> read IXD.STATUS
> read IXD.FRGB
> read IXD.GTNG
> read IXD.HOMO
> read IXD.ANFANG
> readln
>
> [not seqeof] begin
> saverecord IXD
> clear IXD
> show "*"
> calc (recs + 1) to recs
> end
>
> keycheck begin // Eine Taste wurde gedrckt.
> showln // Programm beenden ?
> showln "Eine Taste wurde gedrckt, " recs " Datens"tze
> gelesen"
> show "<ESC> = Ende, beliebige Taste fr WEITER ... "
> inkey temstr
> [key.escape] abort
> showln
> showln
> end
>
> until [seqeof]
>
>
> showln
> showln recs " Datens"tze eingelesen in IXD."
> show "Beliebige Taste fr WEITER ... "
> inkey temstr
> abort
>
>
>
> DATENBANK DEFINITIONEN - Datei-Nr: 5
> ************************************************** ***
> System-Name = ixd
> Benutzer-Name = ixd
> DataFlex-Name = IXD
> ************************************************** ***
> Datensatzl"nge = 85 (benutzt = 83)
> Max. Zahl der S"tze = 16000000 (benutzt = 59142)
> Freier Platz wird wiederverwendet
> Multi-User RE-READ aktiv
> ************************************************** ***
> FELD FELD FELD FELD DEZ HAUPT VERKNsPFUNG
> NUMMER OFFSET LZNGE TYP STE INDEX DATEI FELD
> ------ ------ ----- ------ --- ----- ----- -----
> 1 1 50 ASCII 1 0 0 WORT
> 2 51 1 ASCII 0 0 0 DESTYP
> 3 52 1 ASCII 0 0 0 WST
> 4 53 1 ASCII 0 0 0 ZGR
> 5 54 1 ASCII 0 0 0 MERK003
> 6 55 1 ASCII 3 0 0 FAC
> 7 56 3 ASCII 4 0 0 SGR
> 8 59 2 ASCII 1 0 0 SPRA
> 9 61 2 ASCII 0 0 0 WOA
> 10 63 2 ASCII 0 0 0 GRM
> 11 65 3 ASCII 0 0 0 BRP
> 12 68 2 ASCII 0 0 0 BRA
> 13 70 1 ASCII 0 0 0 AKZ
> 14 71 1 ASCII 2 0 0 MERKER
> 15 72 3 DATE 0 0 0 EDATUM
> 16 75 3 DATE 0 0 0 ADATUM
> 17 78 2 NUMERIC 0 0 0 0 USERNR
> 18 80 1 ASCII 0 0 0 STATUS
> 19 81 1 ASCII 0 0 0 FRGB
> 20 82 1 ASCII 0 0 0 GTNG
> 21 83 1 NUMERIC 0 1 0 0 HOMO
> 22 1 5 OVERLAP 1 0 0 ANFANG
>
> Index 1: Feldsegmente: <8> <1> <21>
> Index 2: Feldsegmente: <14> <22> <0>
> Index 3: Feldsegmente: <8> <6> <22> <0>
> Index 4: Feldsegmente: <8> <7> <22> <0>
>
>
>
>
>

Michael Fenton
23-Mar-2006, 05:20 AM
2 records with WORT and SPRA the same will give the error. 2 blanks
are the same !

Michael Fenton

M fenton
23-Mar-2006, 05:21 AM
2 records with WORT , SPRA and HOMO the same will give the error. 2 blanks
are the same !

Michael Fenton

Roland Wingerter
23-Mar-2006, 07:45 AM
"M fenton" wrote
>2 records with WORT , SPRA and HOMO the same will give the error. 2 blanks
> are the same !
------
Michael and Dave, thank you for your answers.

I am aware this is a unique index and made sure the data are unique too.
Meanwhile I found when I replace the field values in SPRA (short for
SPRACHE,
i.e. LANGUAGE) to something different, the import works as expected. But
this of course is not a solution.

Next I tried to enter a record manually and to my surprise got the
"Duplicate records not allowed" error message. Since I suspected the Index
may have been corrupted, I ran DFINDEX to rebuild it, but the problem
remains.

FWIW, I am trying to import 300 records that start with the string
"Rechtsanwälte" (Lawyers). The table contains 59.000 records, about 700 of
which also start with that same string. I can add records to the table
manually, but none starting with the string "Rechtsanwälte".

I am wondering if that may be an index problem and what I can do to solve
it.

Of course, all and any advice is welcome.

Roland

Roland Wingerter
23-Mar-2006, 08:11 AM
Roland W. wrote
>
> I am wondering if that may be an index problem and what I can do to solve
> it.
-------
I used DFFILE to delete all indexes, then rebuilt them from scratch. That
solved it.

Thank you very much for your help. It is reassuring to know you can ask
someone...

Roland

Joerg Thuemmler
24-Mar-2006, 02:17 AM
Hi,

your talking about "Rechtsanwälte" sends an idea to me: there may be
a collating sequence problem with the german "ä" umlaut, as this is
not in the normal collating sequence. May be a bad idea to use a
field which may contain country-specific chars in unique indeces in
2.3b.

I read there are possibilities to change collating sequence in 3.1
but I don't know, wheather 2.3b has too.

joerg

Roland Wingerter wrote:
> Roland W. wrote
>
>>I am wondering if that may be an index problem and what I can do to solve
>>it.
>
> -------
> I used DFFILE to delete all indexes, then rebuilt them from scratch. That
> solved it.
>
> Thank you very much for your help. It is reassuring to know you can ask
> someone...
>
> Roland
>
>

Roland Wingerter
27-Mar-2006, 04:45 AM
"Joerg Thuemmler" schrieb
>
> your talking about "Rechtsanwälte" sends an idea to me: there may be a
> collating sequence problem with the german "ä" umlaut, as this is not in
> the normal collating sequence. May be a bad idea to use a field which may
> contain country-specific chars in unique indeces in 2.3b.
-------
It is true, the sort order for German Umlaute is not correct, but never has
been and I can live with that. (I have been using this program for more than
10 years.)

> I read there are possibilities to change collating sequence in 3.1 but I
> don't know, wheather 2.3b has too.
-------
Thanks, I am quite content as things are, my problem is solved.

Roland