Subject | Re: [IBO] DML Caching |
---|---|
Author | mkl20uk@yahoo.co.uk |
Post date | 2001-08-29T13:03Z |
Helen
In the simplest dataset I have tried it on, table has a compound
primary key (both are of type Int64):
PCAT_UNIQUE_REF
PCAT_SYSTEM_REF
PCAT_SYSTEM_REF is also a foreign key of another table.
GeneratorLinks
PCAT_UNIQUE_REF=NN_PRODCATS
KeyLinks
PCAT_UNIQUE_REF
PCAT_SYSTEM_REF
OnNewRecord handler:
With IB_Dataset do
FieldByName('PCAT_SYSTEM_REF').AsInt64 := MainForm.SystemRef;
There is a trigger on PRODCATS before insert:
IF (NEW.PCAT_UNIQUE_REF IS NULL) THEN
NEW.PCAT_UNIQUE_REF = GEN_ID(NN_PRODCATS, 1);
In the simplest dataset I have tried it on, table has a compound
primary key (both are of type Int64):
PCAT_UNIQUE_REF
PCAT_SYSTEM_REF
PCAT_SYSTEM_REF is also a foreign key of another table.
GeneratorLinks
PCAT_UNIQUE_REF=NN_PRODCATS
KeyLinks
PCAT_UNIQUE_REF
PCAT_SYSTEM_REF
OnNewRecord handler:
With IB_Dataset do
FieldByName('PCAT_SYSTEM_REF').AsInt64 := MainForm.SystemRef;
There is a trigger on PRODCATS before insert:
IF (NEW.PCAT_UNIQUE_REF IS NULL) THEN
NEW.PCAT_UNIQUE_REF = GEN_ID(NN_PRODCATS, 1);
--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> Martin,
>
> Some pertinent questions to start with:
>
> 1. You say that the first element of your composite primary key is
populated by a generator. Do you have GeneratorLinks set for it?
>
> 2. You say that you are populating the second element in the
OnNewRecord event. Could you please show us the handler code.
>
> 3. What are your KeyLinks?
>
> rgds,
> Helen
>
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________