Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COPY TO .. SDF integer padding bug?
Message
 
To
19/08/2005 13:57:52
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01042355
Message ID:
01042359
Views:
22
Franze,

Could you give an example when the actual error occurs or the padding behavior is not acceptable? For instance, there are no errors in this scenario:
sele junk
APPEND FROM C:\TEMP\JUNK.txt SDF FIELDS INT1, FNAME, LNAME
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform