How work with the generators?
After the method ApplyUpdates, increases the number is not shown.....
And how use it Before., After...
But after closing and opening the conexion again shows. OK
Sorry for your time.
Regards.
Generators in DBExpress
Hi Plash thanks for your interest.Plash wrote:Please specify whether a trigger is used to set field value from the generator. If so, you should call Refresh method of dataset after ApplyUpdates to get new values.
You can call Refresh method from AfterApplyUpdates event handler.
Here he generator code
Code: Select all
SET SQL DIALECT 3;
SET NAMES ISO8859_1;
CREATE GENERATOR GEN_BANCOS_ID;
SET TERM ^ ;
CREATE OR ALTER TRIGGER BANCOS_BI FOR BANCOS
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.CODBANCO IS NULL) THEN
NEW.CODBANCO = GEN_ID(GEN_BANCOS_ID,1);
END
^
SET TERM ; ^