generator field
- From: js.gros@xxxxxxxxxxx
- Date: 27 Oct 2005 05:38:22 -0700
Delphi 2005 / Interbase 7.5
Table test (id smallint, name varchar(20))
generator gen_id_test
trigger :
create trigger tr_id_test for test active before insert position 0 as
begin
if (new.id is null) then new.id=gen_id(gen_ID_test,1);
end
if i insert a nw row manualy (with an insert into test), the trigger
fight, generate a new ID and add the new row
I i try to do that in a DbGrid, I have an error saying that ID Field
MUST have a value
Why ?
If i configure the TQUery.GeneratorField to use may generator to
modify the Id Field, with the "on new record" apply event, the
generator is incrementing by 2 (i think the generatorfield property use
it and then the trigger use it another time)
I i use the "on server" aaply event, all is OK
Why MUST i use the generatorfield property ?
If i want to get the value BEFORE posting the new row, how can i do
(and not having an incrementation by 2 ?) (also i can use a storedproc
to get the next generator value but perhaps is there somethink more
simple ?)
thanks
.
- Prev by Date: Re: ICS FTPServer Disconnect a Client....
- Next by Date: generato field / Apply event
- Previous by thread: Delphi 7 v Delphi 2005
- Next by thread: generato field / Apply event
- Index(es):
Relevant Pages
|