Subject | Problem with Append in a IBOTable |
---|---|
Author | sassicaia70@hotmail.com |
Post date | 2001-08-30T10:39:31Z |
Hi
I have a big problem with Append in a IBOTable
I use IBO 3.6 Dg (demo) because I would like convert my application
from DBF to IBO.
I use IBOTable with PessimisticLock = TRUE and I have this problem:
Source
IboTable1.PessimisticLock := TRUE;
IboTable1.Open;
IboTable1.IndexName := 'COD';
IboTable1.Append;
IboTable1.FieldByName('COD').AsString := '100';
IboTable1.Post;
Database struct
CREATE TABLE "CLIDEST" (
"COD" VARCHAR(10) /* "CODCLI" */ ,
"ID" INTEGER NOT NULL PRIMARY KEY
);
CREATE INDEX "COD" ON "CLIDEST" "COD";
CREATE GENERATOR CLIDEST_ID_GEN;
SET TERM !! ;
CREATE TRIGGER CLIDEST_ID_TRIG FOR CLIDEST
ACTIVE BEFORE INSERT AS
BEGIN
IF (NEW.ID IS NULL) THEN NEW.ID = GEN_ID(CLIDEST_ID_GEN,1);
END !!
SET TERM ; !!
The problem is :
Trigger not start, and ID is not set automatically, by the generator.
Someone has ideas....
Thank you ( and sorry for my english !!!)
I have a big problem with Append in a IBOTable
I use IBO 3.6 Dg (demo) because I would like convert my application
from DBF to IBO.
I use IBOTable with PessimisticLock = TRUE and I have this problem:
Source
IboTable1.PessimisticLock := TRUE;
IboTable1.Open;
IboTable1.IndexName := 'COD';
IboTable1.Append;
IboTable1.FieldByName('COD').AsString := '100';
IboTable1.Post;
Database struct
CREATE TABLE "CLIDEST" (
"COD" VARCHAR(10) /* "CODCLI" */ ,
"ID" INTEGER NOT NULL PRIMARY KEY
);
CREATE INDEX "COD" ON "CLIDEST" "COD";
CREATE GENERATOR CLIDEST_ID_GEN;
SET TERM !! ;
CREATE TRIGGER CLIDEST_ID_TRIG FOR CLIDEST
ACTIVE BEFORE INSERT AS
BEGIN
IF (NEW.ID IS NULL) THEN NEW.ID = GEN_ID(CLIDEST_ID_GEN,1);
END !!
SET TERM ; !!
The problem is :
Trigger not start, and ID is not set automatically, by the generator.
Someone has ideas....
Thank you ( and sorry for my english !!!)