having a FB table with a before insert trigger
Code: Select all
CREATE TABLE TABLEA (ID BIGINT NOT NULL,
NUM INTEGER NOT NULL);
CREATE TRIGGER TABLEA_BI FOR TABLEA
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.id is null) then
new.id = gen_id(gen_tablea_id,1);
end
But doing the same by the use of TIBCSQL with a statement
Code: Select all
INSERT INTO tablea (Num) VALUES (:Num) RETURNING ID;
I would like both - to use the before insert trigger for filling the primary key field ID and to call the TIBCQuery.Post method for posting the data. According to IBDAC help it should work. Please, any hint where am I making a mistake ?