Subject Re: [firebird-support] Record duplication
Author Uwe Grauer
Robin Davis wrote:
> Hi Michael,
>
> Michael Weissenbacher wrote:
>> Hi,
>>
>>> Bless you for that simple but effective solution! The only problem now
>>> is that the newly inserted record comes up with all fields marked as
>>> deleted until you close the form and reopen it - at which point all is
>>> as it should be. Any thoughts - apart from getting them to ditch
> Access? ;-)
>>>
>> my guess would be that access thinks that the record was deleted because
>> the trigger changes the key value "under the hood" without access
>> noticing it. How about giving them an editable view of the table that
>> doesn't include the key column? Would this work?
>>
> Not really, as helen's solution - if I am reading it correctly - still
> requires the user to enter a negative value in the PK field in order to
> work.
>
> Rob
>

In the solution from Helen you do not have to supply a value for the pk.
If you want to do it in a better way, get the pk with
select gen_id (MyGenerator, 1) from rdb$database;
and set the pk for yourself.
This way you know your new pk before.
Now just reread the new record.

Uwe