Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY TO .. SDF integer padding bug?
Message
 
 
À
19/08/2005 14:41:55
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:
01042433
Vues:
20
Franz,

TYPE SDF doesn't explain what rule it uses in determing field sizes, all it does is output a given file with each field a fixed size.

For most practical purposes it's a fairly useless option. If you want a particular file structure either use a SQL-select to create character fields for each column and dump that or use TEXTMERGE to output the file. I have a process that moves millions of rows each weekend between a transactional SQL database and a OLAP SQL database and it uses BCP on the SQL sides and textmerge in VFP for the output to go into the OLAP. It performs quite acceptably.

>Well, I would rather the result were predictable - as I said, the pad amount varies with different numbers of fields, etc... Moreover, I'm bulk loading into SQL SERVER using format files and I don't know how big (in advance) the integer column will be written from VFP, judging from this example.
>
>Here's another interesting example:
>
>
>
>CREATE CURSOR Mewp (int1 I, int2 I, char1 c(10), char2 c(10))
>INSERT INTO mewp (char1, char2, int1, int2) VALUES ('asdf','qwer',1,2)
>INSERT INTO mewp (char1, char2, int1, int2) VALUES ('zxcv','zxcv',3,4)
>INSERT INTO mewp (char1, char2, int1, int2) VALUES ('tyui','ghjk',5,6)
>COPY TO c:\temp\temp1.txt FIELDS char1, char2, int1, int2 sdf
>
>The integers are LEFT justified, 10 characters long
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform