Subject Re: [firebird-support] Avoiding Null value and having basic default values
Author Martijn Tonies
Hi,

> I am using FireBird as a backend for VFP using remote views. When I save
a
> record in my applications fields that are not modified get saved as Null
> this creates problems at the time of reporting. Also say for eg. Double
> Precision numbers show a 0.00 on the app. form but actually the users is
> assuming that a zero is saved, but a Null is.
>
> Please advise as to what I can do to avoid this behaviour?

Well, there are two things to take care of:

1) do you want a NULL? If so, display it as NULL/empty instead of 0.0

2) you can easily change the behaviour in a BEFORE INSERT or UPDATE
trigger:

if (new.mycolumn is null) then new.mycolumn = 0;

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com