Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updateable view using IN/INLIST
Message
De
12/06/2004 06:37:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/06/2004 17:05:56
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00912928
Message ID:
00912998
Vues:
12
>Hi,
>I have a header table with entries for employers and End of quarter (EOQ) dates, one entry for each employer-EOQ combination. A detail table has one or more records for each employer-EOQ.
>
>I need to update records in both tables for an employer for one or more EOQs, but typically not ALL EOQs.
>
>So, I'm trying to figure out how to create updateable views that SELECTs one or more EOQs (I could use a view that collects all EOQs and just updates the EOQs i want to change, but that seems like overkill...the number of related records in the detail file may get very large).
>
>One solution I've read about suggested using a temporary DBC and creating the view w/the specific EOQs required.
>
>Is this the best way? I'd tried using view parameters, and IN/INLIST but couldn't get it to work with a list of dates.
>
>Any suggestions/comments? TIA, J

Jill,
Create a cursor and join with it. ie:
Create cursor CntryList (Country c(10))

* Create the view with a join 
CREATE DATABASE 'INQUERYTEST.DBC'
CREATE SQL VIEW "CUSINSPECIFICCOUNTRY" ; 
   AS SELECT Customer.* ;
   	FROM Customer ;
    inner join CntryList ;
   on CntryList.country = customer.country

* other view properties here


* Test
Insert into CntryList values ('Belgium')
Insert into CntryList values ('Germany')
Insert into CntryList values ('France')

USE inquerytest!CUSINSPECIFICCOUNTRY
Browse

Select CntryList
Zap
Insert into CntryList values ('USA')
Insert into CntryList values ('Sweden')

Requery('CUSINSPECIFICCOUNTRY')
Select CUSINSPECIFICCOUNTRY
browse
Keep in mind "CntryList" is just an alias, it could be the name of a select into cursor. Before using your view (if not with nodataunload) make it availbale and before a requery of view repopulate it first. View itself is in your DBC and no additional DBC is created.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform