Subject Autoinc field value unknown after insert+post+commit
Author jrp_public
Dear IBO users,

I am new to Firebird and IBO.

I have a very basic problem that I have been fighting
for some hours without success (doh!)

Please somebody help me as my curiosity is killing me :)

The story
=========
I have a table with an autoincrementing field which I use as a
primary key. The autoincrementing is the common trigger + generator
thing, which I have verified worked correctly. I use an IB_Query to
access this table (no joins involved). The transaction isolation is
tiCommitted.


The problem
===========
After posting a newly-inserted record, the value of the autoinc field
is NULL.

If I refresh the dataset to get that value then the record pointer
will point somewhere else (it doesn't listen to
RefreshAction=raKeepDataPos).

BufferSynchroFlags, CommitAction=caRefreshKeys, and
RefreshAction=raKeepDataPos don't seem to work as they should. I even
get an error message for trying to delete the record I have just
inserted. I suppose this is because the field value is NULL (remember
that this field is a primary key).

Similar symptoms seem to happen to all fields that get their values
from triggers.

The Question
============
How to tell IBO to update the dataset to reflect changes made by
triggers, without moving the record pointer?

All I want is very simple: After inserting (+post +commit) a new
record, the record pointer should be pointing at the record I have
just inserted, and the value of the autoincrementing / triggered
field is known.

Thank you in advance. Please feel free to email me with an attachment
of sample source code if you think it would help me.

And sorry for my cryptic English :)


JRP