TIBCTable with Firebird AutoInc (IDENTITY) field isn't working
Posted: Mon 27 Jul 2020 13:54
Hello,
I have this Firebird 3.x Table:
CREATE TABLE MyTable (
ID SMALLINT GENERATED BY DEFAULT AS IDENTITY,
...
);
I want to use it with a TIBCTable. I insert a new record, post it, select another record, go back to the newly inserted record. If I want to edit this record than this error is shown:
Refresh failed. Found 0 records.
DBMonitor says:
SELECT NULL FROM myTable
WHERE
ID IS NULL AND ...
FOR UPDATE WITH LOCK
Why ID is null? How to get the generated ID from the AutoInc (IDENTITY) field back to the TIBCTable/record?
If played arround 1 hour, but I can't make it work. Which properties must be set with which values?
I have:
MyIBCTableID.Required = false (otherwise posting is not possible)
MyIBCTableID.AutoGenerateValue = arAutoInc
MyIBCTable.Options.ReturnParams = true
MyIBCTable.Options.DefaultValues = true
MyIBCTable.IndexFieldNames = ID
MyIBCTable.KeyFieldNames = ID
MyIBCTable.LockMode = lmLockImmediate
Thank you!
I have this Firebird 3.x Table:
CREATE TABLE MyTable (
ID SMALLINT GENERATED BY DEFAULT AS IDENTITY,
...
);
I want to use it with a TIBCTable. I insert a new record, post it, select another record, go back to the newly inserted record. If I want to edit this record than this error is shown:
Refresh failed. Found 0 records.
DBMonitor says:
SELECT NULL FROM myTable
WHERE
ID IS NULL AND ...
FOR UPDATE WITH LOCK
Why ID is null? How to get the generated ID from the AutoInc (IDENTITY) field back to the TIBCTable/record?
If played arround 1 hour, but I can't make it work. Which properties must be set with which values?
I have:
MyIBCTableID.Required = false (otherwise posting is not possible)
MyIBCTableID.AutoGenerateValue = arAutoInc
MyIBCTable.Options.ReturnParams = true
MyIBCTable.Options.DefaultValues = true
MyIBCTable.IndexFieldNames = ID
MyIBCTable.KeyFieldNames = ID
MyIBCTable.LockMode = lmLockImmediate
Thank you!