Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY TO .. SDF integer padding bug?
Message
 
À
19/08/2005 13:57:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01042355
Message ID:
01042364
Vues:
19
>Hi - I have been working with moving data back and forth between SQL SERVER and VFP9 and utilizing a sort utility that uses fixed width files for extremely high performance. This obviates the need for using SDF format when we copy data from Foxpro (the DBFs are very large) and performance is quite good.
>
>I have noticed a *reproducible* anomoly that is baffling, yet makes the above scenario unworkable. I am including exact code to reproduce the error. The conclusion is that when one does a COPY SDF of a DBF, integer columns sometimes have extra data padded onto them, ie., the resultant width isn't 11 bytes like it should be.
>
>Here is the code demonstrating the problem -
>
>CLOSE DATABASES ALL
>CREATE TABLE c:\temp\junk (fname c(15), lname c(25), int1 I)
>INSERT INTO c:\temp\junk VALUES ('JOHN','SMITH',1)
>INSERT INTO c:\temp\junk VALUES ('JANE','SMITH',2)
>INSERT INTO c:\temp\junk VALUES ('STEVE','SMITH',3)
>INSERT INTO c:\temp\junk VALUES ('SAMANTHA','SMITH',4)
>COPY FIELDS INT1, FNAME, LNAME TO C:\TEMP\JUNK SDF
>MODIFY FILE C:\TEMP\JUNK
>
>
>When you view the file C:\TEMP\JUNK.TXT, the first column, int1, has the integer column padded to 11 bytes but then adds four (4) spaces before the FNAME column starts!
>
>          1    JOHN           SMITH
>          2    JANE           SMITH
>          3    STEVE          SMITH
>          4    SAMANTHA       SMITH
>           ^^^^
>   (note the extra spaces)
>
>
>This is absolutely baffling. One of my coworkers said he has seen this since VFP6 and has always had to work around it. He has even reproduced it by taking a table, COPY SDF, and APPEND SDF and have it fail due to this 'phantom padding' of INT columns that occurs.
>
>Finally, if INT columns are the LAST COLUMN of the dump, it doesn't pad it. But we have some tables in which integers are padded by as many as 14 spaces when we COPY SDF.
>
>Any ideas? Am I seeing things?
>
>Thanks,
>
>Franz Nisswandt


Franz
by me the result is the same.
I try this code with VFP8. The same result.
But with
COPY FIELDS FNAME, LNAME, int1 TO C:\TEMP\JUNK SDF  &&& all is O'k
and with this code again no problem
CLOSE DATABASES ALL
CREATE TABLE c:\temp\junk ( int1 I, fname c(15), lname c(25))
INSERT INTO c:\temp\junk VALUES (1,'JOHN','SMITH')
INSERT INTO c:\temp\junk VALUES (2,'JANE','SMITH')
INSERT INTO c:\temp\junk VALUES (3,'STEVE','SMITH')
INSERT INTO c:\temp\junk VALUES (4,'SAMANTHA','SMITH')
BROWSE NORMAL
COPY FIELDS INT1,FNAME, LNAME TO C:\TEMP\JUNK SDF
MODIFY FILE C:\TEMP\JUNK
My opinion is that this is bug.
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform