Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
So basically, like the title says, I'm having multiple files loaded with a wildcard in the FROM statement. All files start with 'Leveringsbonnen' and they are loaded through a FROM statement as follows "Leveringsbonnen*"
The preceding load was done as follows (the commented code):
// LOAD // *, // Best.Bon & '|' & Code AS CatKey // ; LOAD Adrescode, Leveradres, Naam, Adres, Woonplaats, Tel., GSM, Fax, DocNr, Datum, Best.Bon, Referentie, Artikel, Omschrijving, Aantal, "Waarde in EUR", Num(Gem.Prijs) AS Gem.Prijs, Grootboekrek., Artikelgroep, Subartikelgroep, Replace(FileBaseName(),'Leveringsbonnen','') AS Code FROM [lib://Customer/Leveringsbonnen*.txt] (txt, codepage is 28591, embedded labels, delimiter is ';', msq);
Problem is, for one of the 7 files, it doesn't do the preceding load, which in turns prevents the autoconcatenate.
Anyone has any idea how this is possible? Thanks in advance.
Regards,
Tim P.
I think without any other error-message your aproach should work. This means I assume that there is any other error like a missing field, a different file-format or something similar. Your datamodel will show this extra table so that you could look on the file if there is anything unexpected.
Beside this it's often better to use a loop with filelist() instead of applying the wildcard directly into the load-path. By such an approach you could enforce a concatenating even by not identically datastructures and also applying a lot of further checkings: Loops-in-the-Script.
- Marcus
Hi Marcus
That's the strange thing, it doesn't throw any errors, all fields are the same, but for that 1 table (out of the 7), it doesn't execute the preceding load.
I'm using the exact same load structure (preceding + wildcard in FROM) for another set of 7 tables and again, it loads all tables perfectly, except one where the preceding load isn't executed. Both times it's the 2nd file down the list where something goes wrong.
For now I've been able to solve my problem through a resident load (the first load was a Temp table, so the resident had to happen anyway), but I'll look into the loop with filelist to see if the same issue occurs.
Thanks!