Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field validation default value firing order
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Field validation default value firing order
Miscellaneous
Thread ID:
00396707
Message ID:
00396707
Views:
27
I have a lookup table with a pk, field validation default is a stored procedure newkey(), another field, madedt defaults to datetime()

I needed to duplicate a block of 20 records or so, so I copied them to temp.dbf. Looked in temp and they are there, pk's and madedt unchanged, as expected.

Switch to the original table, append from temp. The 20 records come in without any complaints, they have a newkey() generated value replacing the prior pk, the newest key is stored in keylist.dbf

The old datetime() is still stored in madedt.

This is what I wanted, but I am a bit puzzled as to why it happened.

Why did the appended record pk field get overwritten by the newkey(),
but the madedt did not get overwritten by the datetime()

I guess I expected the fields coming in with values to keep them and the pk to be violated. Does a udf, newkey() here, get evaluated later, and the function datetime() did not?

Any explanation?

TIA,

Al Allison
Reply
Map
View

Click here to load this message in the networking platform