Subject Re: [IBO] About post, commit, delete
Author Helen Borrie
At 10:38 AM 22/09/2003 +0200, you wrote:
>I think, that I have set KeyLinks (DB has dialect 3):
>pQuery->KeyLinks->Add( "CLASS_DANCES.\"ClassDance_ID\"" );
>ClassDance_ID is table's PK, generated by generator & before insert trigger

You *still* have the keylinks problem with inserts though, because you are
letting the trigger create the primary key. You need to do this:

1. Make your trigger:

create trigger atrigger for "CLASS_DANCES"
active before insert
as
begin
if (new."ClassDance_ID" is not null) then
new."ClassDance_ID" = gen_id(YourGenerator, 1);
end

then
2. Set the GeneratorLinks property:

"ClassDance_ID"=YourGenerator

This enables the dataset to fetch the new PK value during the BeforeInsert
phase and add it to the key buffer. Then, your inserted row is all taken
care of after the commit, with BufferSynchro.

Helen



>At 2003.09.22 01:41, you wrote:
> >will find it exactly on the server. You get the error because you don't
> >have keylinks.
>
>
>
> --/ Gediminas /--
>The Truth Is Out There
>
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/