Subject | Re: [IBO] Re: clearing comboBox in grid does not produce NULL |
---|---|
Author | Helen Borrie |
Post date | 2003-04-02T04:37:23Z |
At 03:50 AM 2/04/2003 +0000, you wrote:
based on a generator:
create trigger bi_atable for atable
active before insert position 0
as
begin
if (new.PK is null) then
new.PK = gen_id(gen_atable_pk, 1);
end;
And, just remember, you can't test anything in Delphi directly for null,
unless it is a variant type.
Luckily, IBO has the ib_column.IsNull method that looks after this problem
for us, in most cases; and ib_column.Clear, to enable us to pass Null to a
parameter.
Helen
>Is my only option to explicitly test for NULL first?Yes, always. For example, here is the standard trigger for an autoinc key
based on a generator:
create trigger bi_atable for atable
active before insert position 0
as
begin
if (new.PK is null) then
new.PK = gen_id(gen_atable_pk, 1);
end;
And, just remember, you can't test anything in Delphi directly for null,
unless it is a variant type.
Luckily, IBO has the ib_column.IsNull method that looks after this problem
for us, in most cases; and ib_column.Clear, to enable us to pass Null to a
parameter.
Helen