General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Field validation default value firing order
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only