Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Textmerge to capture SELECT result
Message
De
11/09/2013 19:31:45
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01582914
Message ID:
01582919
Vues:
50
>>Even when I was doing a lot of VFP TEXTMERGE never seemed intuitive to me. Right now I'm floundering
>>
>>It seems that in order to get a delimited file that works well with a bulk insert to SQL ( i.e. separation with | or something like that and no quotes anywhere ) I need to use TEXTMERGE
>>
>>Is there a better way than to SCAN and build the line using delimited fields inside the TEXTMERGE
>>
>>
>>
>>TEXT TO lcSQL NOSHOW TEXTMERGE
>>
>>SCAN
>>\\<<cid>>|<<name>>|<<address>>|<<balance>>
>>ENDSCAN
>>ENDTEXT
>>
>>
>>
>>Is there a way to get COPY TO to just create a | delimited text file with no quotes for character fields? ( man I hate the way VFP uses "delimiter" where it should be "separator")
>>
>>TIA
>>'
>
>Try
>
>COPY TO 'PipeDelimitedFile.txt' DELIMITED WITH "" WITH CHARACTER '|'
Turned out to be a very good way to go. Table has 2.5 million records. 6 columns had to be transformed from GUID(16) to GUID(32) . First did a SELECT to do the transform then the COPY to to create the text file. That took about 10 seconds all together. Bulk upload on the SQL side took about another 10 seconds.


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform