we have some trouble with a BlackFish db, autoincrement fields and clientdataset:
To create a autoincrment col with dataexplorer create a new table.
First col Name 'ID' and set type to INTEGER AUTOINCREMENT.
Second col 'Name' Varchar
OK! That works fine and BF does, what to do.
All SQL statements works too...
But we have a win32 (IW=VCL for the web) client server application with a dbx connection, sql DataSet and provider and ClientDataset (united within SimpleDataSet)
"SampleDtaSet" with 'ID' and 'NAME' cols for instance. The
query is 'Select * from new'
Now I want to append (or insert) a record to the (first) ClientDataset:
(C++ syntax)
SampleDtaSet->Append();
SampleDtaSet->FieldByName("NAME")->AsString = "Joerg";
SampleDtaSet->Post();
Now app failed with "exception 'ID' is empty"! We tried to set the field property 'Required' to 'false' for 'ID' but not success.
If we test a number like
SampleDtaSet->FieldByName("ID")->AsInteger = 5;
after
SampleDtaSet->ApplyUpdates(0);
the ID field is set by the AUTOINCREMENT mechanism.
But what happens, if '5' is present before->Exception and s.o.
Why or how have I to set the ID before post the ClientDataset?
For me a problem like 'cat hunts the tail'
We would like to know the value of an autoincrement-column of a
BlackfishSQL-DB before the insert-statement is executed. The reason: The column is required and that's why we are getting the exception "Column-Value required" (post of clientdataset!)
That's my Question
with
regards
Joerg
--
Bill Todd (TeamB)