Subject Re: [IBO] IB_Query - Refresh
Author Helen Borrie
At 12:16 PM 19-11-01 +0100, Petr Potocek
wrote:
>Hello,
>I have problem with REFRESH.
>I do:
>
>IB_Query1.Insert;
>..
>IB_Query1.Post;
>IB_Query1.Refresh;
>
>I need to stay on current inserted row. I have trigger (before insert), which replace primary key of the table.

Petr,

The dataset has no way to know what that primary key is. Triggers fire on the server, not in the client.

Is your trigger firing a generator?
If yes, then change it to

if (new.PK_COL is null) then
new.PK_COL = gen_id(MyGenerator, 1);

Then, use GeneratorLinks to ensure that the dataset will know what the primary key is.

If no, then write a stored procedure to create the primary key and call this stored procedure as a function to return the new primary key into your BeforeInsert handler.

regards,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________