Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexes with fields from another table
Message
De
21/02/2001 11:20:59
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/02/2001 09:51:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00477736
Message ID:
00478009
Vues:
26
>>create local view MyViewName as select list_of_fields from Equipment join Vendor on Equipment.Vendor_ID = Vendors.KeyID where Equipment.Vendor_ID = ?nVendor_ID order by whatever
>>
>
>One of my tables, for motors, has to link to vendors,equip,mcc,dcs & commain; five different Key IDs, five different Joins.
>
>My experience is when I have more than two "Left Outer Joins" in a single view statement that those beyond the first two do not work. They enter the same single value over and over. That is it enters the same vendor for each record even when the Key ID points to a different one.

You'd have to create the view in code, ViewDesigner (aka VD) has a limitation on the number of joins it can handle; you'd be better off using Erik Moores eView (check up Files section). It also has a nasty habit of listing all the Join clauses first, then all the On clauses - which confuses the hell out of the SQL parser. The order which works is to pair each Join with its On clause.

Indexing the table on fields from another table was something I used extensively for reporting purposes back in mFoxPlus 2.1, eleven years ago, when we still didn't have any SQL in Fox. It worked - as long as you had a relation set to the other table, else you got very funny results. It was tricky, slow, unstable etc, but in some situations it was still the fastest and easiest way to have things sorted by a name field from a lookup table. I wouldn't try that again - creating cursors or views is so much easier to both create and maintain.

>Also how do you handle updates made by my user? He changes the vendor assigned to the current record (changes the vendors_id in the current record). Do I then requery the entire view to get it into the proper order and show the change to the user?

Yes, but your "entire" view doesn't need to be big - just the few records that the current unit (order, batch, pack, whatever) you're working on consists of. This means the view is supposed to be parametrized, so that you work with a reasonably small number of records at a time. The fewer, the faster, of course.

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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform