Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update -SQL how to?
Message
De
12/11/2004 03:14:40
 
 
À
12/11/2004 02:17:16
Suhas Hegde
Dental Surgeon
Sirsi, Inde
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 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
00960359
Message ID:
00960708
Vues:
12
The local view approach use a similar update-sql like Terry Mcdonnell showed to you.
* create the view
open databases stocks.dbc
create sql view lv_update as ;
   select bhav_data.delqty as bqty, bhav_data.symbol as bsym, ;
      bhav_data.series as bser, bhav_Data.date as bdat, ;
      del.symbol as dsym, del.series as dser, del.date as ddat ;
   from stocks!bhav_Data inner join stocks!del ;
      on bhav_data.symbol=del.symbol AND ;
      bhav_Data.series=del.series AND ;
      bhav_data.date=del.date

DBSetProp("lv_Update.bsym", "FIELD", "KeyField", .T.)
DBSetProp("lv_Update.bser", "FIELD", "KeyField", .T.)
DBSetProp("lv_Update.bdat", "FIELD", "KeyField", .T.)
DBSetProp("lv_Update", "VIEW", "WhereType", 1)
DBSetProp("lv_Update", "VIEW", "UpdateType", 1)
DBSetProp("lv_Update", "VIEW", "SendUpdates", .T.)

*use the view
update stocks!lv_update set bqty=dqty
TableUpdate(.T.)
Make sure you make a file lock to speed things up(for update sql).
The problem you facing is depending of record size.
- Yes! The size does matter - symbol and series alone for 200000 records increase the size of dbf with 6,4 MB (compared with a integer type) (what i mean to say is instead of c(20) use a integer, make dbfs for identification of series and symbol).

Make analysis on selectivity of indexes : in condition use the indexes in descending order of selectivity
Mecu Sorin
mecusorin@spymac.com
There is no spoon! Use your hand.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform