Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table without PK - do I need one for View?
Message
From
25/10/2001 11:17:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00573010
Message ID:
00573221
Views:
34
>>>>Nadya,
>>>>
>>>>You don't need a PK for an updatable view. Just tag all of the compsite key fields as the key in the view designer. Of course, a PK puts less strain on the database engine and reduces the size of the WHERE clause.
>>>>
>>>>- Keith
>>>
>>>Keith,
>>>
>>>The problem is: one field in Integer and two other fields are character. Will it work? I want to discuss the possibiities with my manager. One quick related question: Append from doesn't update PK (if it has default value set), right? So, I had to re-write all code to use scan insert endscan instead, if I choose PK route...
>>>
>>
>>You wouldn't create a concatanation just mark them as keyfields.
>>If PK has a defult value and you don't pass it a value it would update from default.
>>OTOH I couldn't understand why you ever need a view for a single table when it's local (actually never understood why someone might need it).
>>Cetin
>
>I believe, view is better, than filter. Basically I need to show all records for particular DsID and extrweek in a range: current and 3 back. I also should be able to switch to full view, so no limitation on DsID. So, I planned to create this view:
>
> select * from FilingDate where between(DSID,?lnIdLow, ?lnIDHigh) and between(state+extryear+extrweek, ?lcStWeekLow, ?lcStWeekHigh)
>
> A little complication with calculating prior weeks, but quite trivial. The problem is, how can I make this view updatable. As everyone explained, I can leave this table as it is and don't add a PK, though from some other point of view this would be easier...

Nadya,
Read my reply to Hilmar. I'm not talking about filters but set key to or relation.
PS: I never (almost never) use filters.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform