Subject | Re: [Firebird-Architect] Denullify a database |
---|---|
Author | Milan Babuskov |
Post date | 2004-09-10T14:59:38Z |
Geoff Worboys wrote:
created them, and said they support Interbase should have known better.
It is also a responsibility of application developers to use their
interfaces. BTW, could you name some of the "many", I know only one
(Delphi), and workaround is much simpler then generating triggers.
and applications.
or whatever.
single BEFORE/AFTER UPDATE trigger. I do have many on insert and delete
operations, but none of them addresses this issue.
If a field can be empty, just like you wrote the client doesn't care if
it is null, 0, or ''. So why bother, just declare field nullable, and
leave it components you use to insert nulls.
Just my $0.02 (ok, maybe a little more).
Regards,
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org
> Performance and efficiency:I believe this is a responsibility of these "many interfaces". However
>
> Many interfaces prepare a full insert statement regardless
> of whether values are entered into a particular field by the
> user. Thus NULL will often get submitted by the application
> and prevent normal DEFAULT values from being applied by the
> server (and so NOT NULL on the fields result in exceptions).
created them, and said they support Interbase should have known better.
It is also a responsibility of application developers to use their
interfaces. BTW, could you name some of the "many", I know only one
(Delphi), and workaround is much simpler then generating triggers.
> This can be avoided by preparing a new insert statement forGood point.
> each insert, so the insert statement can be created to only
> include fields with values supplied. As you can imagine this
> is far from efficient if many inserts are being performed.
> Having a default that can apply to null columns, whether theWhat if I really want to insert NULL in column that has a default value?
> NULL was specified on the insert or the result of the column
> not being specified, allows inserts to be more efficient.
> If the enforced assignment of default values was to occurAnd make a lot of trouble with backward compatibility of both databases
> before any insert or update triggers are fired it becomes
> possible to write trigger code that can assume valid input
> values - allowing the code to be much clearer and more
> succinct.
and applications.
> In a great many applications the distinction between NULLI disagree. I diffrence is huge.
> versus "empty" (0 number or blank string) is not relevant.
> Indeed in most of my work the users really do not want toWhy not do it in your application? Set the fields initially to 0 or ''
> know about "missing" values, it is not of any interest. If
> they dont supply the value they generally expect it to be
> empty (not missing/null/unknown).
or whatever.
> If I can create my tables/columns such that enforced defaultsWell, I guess it's just your POV. In all my applications I don't have a
> are there in the declaration, I have not only reduced the work
> of writing triggers, I have also declared the intentions of my
> design in clear and easy to read form (rather than browsing
> huge amounts of trigger code). And this has got to be a good
> thing.
single BEFORE/AFTER UPDATE trigger. I do have many on insert and delete
operations, but none of them addresses this issue.
If a field can be empty, just like you wrote the client doesn't care if
it is null, 0, or ''. So why bother, just declare field nullable, and
leave it components you use to insert nulls.
Just my $0.02 (ok, maybe a little more).
Regards,
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org