Subject [IBO] Re: Default values not defaulting for some field
Author ming
HI all,

thanks to send2iwan, Jason dan Helen
for support

after i call my friend iwan, i told me about the computed
ColumnAttributes.Strings = (
'LAST_USER=COMPUTED')

this is very uniq different than timestamp and integer type data
in getserverdefault

case resolved Hore

GBU all

--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 12:00 PM 1/02/2012, ming wrote:
> >hi all
> >
> >my problem for default value still error in ibo even i use the newest ibo, any sugestion for my problem?
>
> I think you misunderstand how the Firebird/IB column default works...
> 1. It works ONLY for an insert; AND
> 2. It is not available until the record is written to disk; AND
> 3. It is not written if the column name is supplied in the column list.
>
>
> >because the trigger can be alternative but i think not eficient for every table i must add before insert for 1 field only type data varchar.
> >
> >Need solution, any body help me please...
>
> You could provide custom InsertSQL for your datasets, leaving the defaulted column out of the INSERT statement.
> *or*
> You could use the DefaultValue attribute of the field in the dataset. However, this is not ideal as it binds your application layer to the database too tightly.
> Along the same lines, if you are using domains for these columns, you can use IB_Connection.DefaultValues to provide domain_name=value strings for any application level. This still has the tight binding limitation.
>
> In my view, the Before Insert trigger is the only good solution from the point of view of data integrity. If you write it correctly, you will always get the value you want, regardless of the application. The SQL default is almost entirely useless.
>
> Why do you think it is too much work? Are you maintaining proper DDL scripts for your databases?
>
> Helen
>