Subject Re: [Firebird-Architect] Extended field/domain DEFAULT usage
Author Jim Starkey
Adriano dos Santos Fernandes wrote:

>Dmitry Yemanov wrote:
>
>
>>"Jim Starkey" <jas@...> wrote in message
>>news:<43BC21BF.3080804@...>...
>>
>>
>>
>>>Any, returning to the original topic, I don't see any problems with
>>>support UDFs in default value clauses for domains. Do you?
>>>
>>>
>>>
>>What about "DEFAULT MY_UDF((SELECT VAL FROM MY_PROC), GEN_ID(MY_GEN, 1))"
>>and alike? :-)
>>
>>
>>
>There is another problem related with DEFAULT and GEN_ID.
>
>If you have a NOT NULLable field and alter a column to have a DEFAULT
>with GEN_ID, records stored in the previous format will evaluate the
>DEFAULT clause in each fetch and the generator will be incremented.
>
>
>
Huh? That isn't how it works. The default value is evaluated and
assigned during record initialization during processing of the store
verb. It's never evaluated on fetch.