Subject | Re: [IBO] DML Caching |
---|---|
Author | Helen Borrie |
Post date | 2001-08-29T13:13:16Z |
At 01:03 PM 29-08-01 +0000, you wrote:
or, failing that ...).Value := ....
Also,
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>HelenOK
>
>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.OK
>GeneratorLinksOK
>PCAT_UNIQUE_REF=NN_PRODCATS
>KeyLinksOK
>PCAT_UNIQUE_REF
>PCAT_SYSTEM_REF
>OnNewRecord handler:Here is where the variant conversion problem is. My guess is that your SystemRef variable is not a variant, right? Try changing the code to ...).AsInteger := ....
>With IB_Dataset do
> FieldByName('PCAT_SYSTEM_REF').AsInt64 := MainForm.SystemRef;
or, failing that ...).Value := ....
Also,
>There is a trigger on PRODCATS before insert:That's OK too; although it won't be fired for your application inserts because GeneratorLinks fetches the generator value for you. It's a good safeguard in case someone is working with the data interactively.
>IF (NEW.PCAT_UNIQUE_REF IS NULL) THEN
> NEW.PCAT_UNIQUE_REF = GEN_ID(NN_PRODCATS, 1);
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________