Subject | Why Firebird AutoIncrement not trigger? |
---|---|
Author | smching2001 |
Post date | 2003-05-10T02:22:16Z |
I'm using Borland 6 & Firebird 1.0 and created a table with three
fields:
DEPARTMENTID : INTERGER NOT NULL <== P.KEY
DEPARTMENTCODE : VACHAR(8)
DEPARTMENTNAME : VACHAR(40)
Where the column special of DEPARTMENTID is set to Create
AutoIncrement Trigger & Generator as follow:
begin
if (new.DEPARTMENTID is null)
then new.DEPARTMENTID = gen_id(DEPARTMENT_GEN, 1);
end
The problem is when I insert data using the DBgrid, it always
prompted me to enter the Value of DEPARTMENTID.
If I don't enter the value for DEPARTMENTID, error occured.
Until I enter an unique value then I can continue. Why?
Thanks
fields:
DEPARTMENTID : INTERGER NOT NULL <== P.KEY
DEPARTMENTCODE : VACHAR(8)
DEPARTMENTNAME : VACHAR(40)
Where the column special of DEPARTMENTID is set to Create
AutoIncrement Trigger & Generator as follow:
begin
if (new.DEPARTMENTID is null)
then new.DEPARTMENTID = gen_id(DEPARTMENT_GEN, 1);
end
The problem is when I insert data using the DBgrid, it always
prompted me to enter the Value of DEPARTMENTID.
If I don't enter the value for DEPARTMENTID, error occured.
Until I enter an unique value then I can continue. Why?
Thanks