Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.Net the only alternative to VFP?
Message
De
01/04/2007 18:24:09
Walter Meester
HoogkarspelPays-Bas
 
 
À
01/04/2007 16:24:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01208148
Message ID:
01211049
Vues:
18
If you're at it. could you provide the full and working equivalent of the example rather than XML? And then please tell me which one is easier and has less dependencies on installed addons ?




>We are talking about EASE of getting data in and out and not the ADVANCED possibilities and even in that arena I've got doubts (Try to import COBOL data files e.g.). You want to to do a contest of getting a comma delimited file into a cursor or table? How about the following example..
>
> CREATE CURSOR Items (Item C(10), Desc C(200), Price N(8,2))
> APPEND FROM (GetFile("csv")) TYPE CSV
> SELECT * FROM Items WHERE Item IN (SELECT Item FROM Items GROUP BY Items HAVING COUNT(*) > 1) INTO CURSOR Y
> COPY TO MyExcellsheet TYPE XL8

>
>I'm not sure if I would do this inside a database or from the application, but I know that it can be done in pure T-SQL. I forget the exact syntax for writing out Excel, but short of it, here's how you'd do it to XML:
>
>
WITH ItemList (ItemNumber, ItemDescr, Price)  AS
>  (SELECT * FROM OpenRowSet('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
>      DefaultDir=C:\;','select * from items.csv'))
>
>SELECT * FROM ItemList WHERE ItemNumber IN
>            (SELECT ItemNumber FROM ItemList GROUP BY ItemNumber HAVING COUNT(*) > 1)
>       FOR XML AUTO, ELEMENTS
>
>
>(I'm just illustrating common table expressions, you could create a table variable or temp table just as easily)
>
>Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform