Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set relation to in SQL database
Message
De
11/12/2006 12:31:23
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
11/12/2006 11:38:10
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01176444
Message ID:
01176600
Vues:
11
>Assuming in my report cursor (for eg sales data), I have codes for the following :-
>1) Salesman Code
>2) Product Code
>3) Customer Code
>4) Location Code
>5) Dept Code
>6) Month
>7) Sales Invoice Number
>8) Sales Invoice Amount
>
>In getting to my final cursor, assuming SQL is used, I would have to join the cursor with 5 master files. Assuming the sales records number a quarter of a million invoices, then joining 5 tables could take a long time....
>Haven't tried that yet but my customer's database contains 400k records just for product codes alone.
>
>Would this be faster using store procedures or query to VFP and index and set relation?

I'd do the whole thing in one long SQL command and bring the final result set in a single SQLExec() call. Depending on the complexity of the join, I may even create temp tables on the server - whatever is faster. But in the end, I'd bring down ONE cursor from the server, which would contain everything I need for printing. Maybe two cursors, one with the sales headers, one with sales items. Then I'd just index the items cursor, set relation from headers into it,and then edit the report to replace aliases where needed.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform