|
From: Adriano d. S. F. <adr...@gm...> - 2009-11-14 19:25:57
|
Ann W. Harrison wrote: > Adriano dos Santos Fernandes wrote: >> So I think on an alternate way. At field creation time, its default >> value may be written in RDB$FORMATS. When reading a NOT NULL field >> with a DEFAULT, the value written in the format version of the >> record is returned. This may solve the problem of complex expressions, >> the problem of transaction visibility, and don't need an update on the >> whole table. I've no code to prove this, it's just an idea. >> > > How would you handle the case of a default of USER or CURRENT_TIME? > For DML, DEFAULT applies in the moment of INSERT. My feeling is that for DDL, the new field of existing records should have the DEFAULT value evaluated in the moment of the DDL command is executed. Storing it value in the format allows that. New records can't have the field with NULL, so some other value will be provided by the user or evaluated with the DEFAULT expression as now. Adriano |