Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default values dropped from view
Message
 
To
02/07/2008 22:23:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01328176
Message ID:
01329268
Views:
11
Ken,

I have used this same methodology for my tables and use views for adds and updates of records. I have the default ID generated using a procedure which looks into a ID table that has a row for each table that needs an ID number. The table has a column that holds the last number assigned and increments it when adding a new record. (I did all this before auto-increment was available in VFP).

The default value I use is defined in the table and not the view and I have never had a problem with this. I can't comment on why your default value property disappears randomly. Do you re-generate view definitions for any reason when making changes to your database? If so, this might be where the default value property gets cleared out.

Bob

>Hi Bob,
>
>Thanks for the reply. Yes, I also check the update criteria for the UID field in the view also (learned that quickly the hard way).
>
>But the issue here is the default value property of the UID field. It seems to randomly disappear from the view definition so for new records in the view doesn't get a UID. This of course affects future modification/updates to the record and can also cause primary key conflicts (two UIDs with value = '').
>
>The reason I do it this way it to always have the UID available immediately after creating a record. If I put the UDF in the table (or use autoincrement) then I have to requery the view and determine which was the new record to get access to the new UID.
>
>How do others do it?
>
>Ken
>
>
Previous
Reply
Map
View

Click here to load this message in the networking platform