Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 7 Jahren, 6 Monaten
Letzter Beitrag:
vor 2 Jahren, 10 Monaten
Beteiligte Autoren:
Al, Manfred, marc.muylaert, Harry, eldhose.pcs.crosspost

How to merge two table with same structure(HF Classic)

Startbeitrag von eldhose.pcs.crosspost am 05.12.2010 15:22

hi,

i had split my large table into 10 hfclassic file.now i want to merge these into one table.i searched in the documentation but i didn't find any solution how could i do.
does anyone know how can i merge these files ?

thanks
eldhose


Message forwarded from pcsoft.us.windev

Antworten:

Hey Eldhose I think that you need do a routine that consider

// Routine to read 10 hf clasic files
// Sequential read each table to other table
0 a for for iteraction each table

1- a while to bucle each table

2- begin with the 1st record of the first table (point 1 time each table)

3 While to detect the end of archive

3- Sequential procedure this record readed append to mother table

4 use flag to control of operations

5 when u finish 1 then add 2 to next table

and so on...


Expect that guide something
:spos:





von Manfred - am 05.12.2010 16:59
Hi,

I think you have to look at 'data source' and HAlias.

Regards Harry

von Harry - am 05.12.2010 21:52
Hello Eldhose

Windev does not have tables, it has files. Are you talking about an external database table (Mysql or other) that you split into HF Classic files ?

To bring the HF Classic files into one file, either create a new file to hold the merged data or select one of the existing files to become the master file and use HCopyRecord() to transfer the data from the other files in an Hread() loop on each of the subsidiary files.

You don't mention if any primary of foreign keys are involved. If so that will present additional problems.

Regards
Al

von Al - am 05.12.2010 22:03
AI no need so strict, i think that the tables that mention Eldhose usually identifiy the ""HF" Hyperfiles files, it never clear how is the structure.

In Visual Fox Pro have

1- Database names

2- Inside : Tables

My database------------
Customer.dbf ( Table)
Product.dbf ( Table) and so on

In Windev have

1- Analysis name


""""""my Analysis""--------
Customer (file)
Product (file)

and in the same worlds u have the identical structure or near

If you have a hex editor can see some blocks identicals.

Regards
Manfred.:spos:






von Manfred - am 06.12.2010 00:01
Hello Manfred

Quote
Manfred
i think that the tables that mention Eldhose usually identifiy the ""HF" Hyperfiles files, it never clear how is the structure.


You have described the point I was making. We cannot be sure exactly what Eldhose means when he refers to a table. The use of "Table" to mean a file is confusing in WIndev related discussions because in Windev a table is a grid displaying data on the screen.

One of the keys to programming in WIndev is to think "windev" and when forum users describe their problems in terms of their other languages rather than Windev it makes it harder to figure out exactly what they are asking and how to best help them.

The confusion between tables and files is one of the most common, so I think it is important to always clarify the distinction.

Regards
Al

von Al - am 06.12.2010 19:57
Here is some code, in my case I needed to merge files with the same name. No index checked! Edit_File example : file1.fic

sfileSource is string = Edit_PathSource + Edit_File
sfileTarget is string = Edit_PathTarget + Edit_File
HDeclareExternal(sfileSource,"sourcefile","password")
HDeclareExternal(sfileTarget,"targetfile","password")
FOR EACH "sourcefile"
HCopyRecord("targetfile","sourcefile",hDefaultVal)
HAdd("targetfile")
END
HCancelDeclaration("sourcefile")
HCancelDeclaration("targetfile")

von marc.muylaert - am 15.08.2015 14:34
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.