Subject Re: [ib-support] string concatination, triggers
Author Helen Borrie
At 05:09 AM 07-04-01 +0200, you wrote:
>If I define a computed column like the one in documents:
>full_name computed by (first_name || ' ' || last_name)
>It works only if non of the two composing columns is null. Otherwise, the
>value is null if any of the two is null.

Correct. Value + NULL evaluates to false.

>Is there any way to make it without
>the need to write additional code like the stuff: if (first_name is null)
>then full_name = last_name else...

No, you will need procedure logic to achieve it, until Ann H. writes our NULLIF() function into Firebird. :)

>Can a trigger be defined to "trigger" at different events. I mean is there a
>way to make the following work:
>create trigger my_trigger for my_table
>before insert or update as
> begin
>
> end

No. You need to define each trigger separately.

Cheers,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________