NULL values not allowed anymore and giving an error on open

Since our upgrade to the latest 9.x RemObjects/DataAbstract SDK
it seems the ‘required’ flag for DA fields has become mandatory for primary keys.
This breaks our code.
We have many routines where we have select statements where tables are joined and the primary key
of our main table is not always present.

When we open the table NULL values should be allowed.
When we change the table the primary key must be set of course.

Can we revert to the old behavour?
Note: Via the GUI the required flag cannot be unchecked

TIA,
Frederic

Hi,

Pls specify what platform you are using (Delphi, .NET, etc).
from what version of DA you have upgraded to DA9?
Primary keys cannot be nil so you may uncheck Primary key & Required in Schema Modeler and refresh schema on client-side for allowing them take NULL value

Hello Evgeny
The problem occurs in our delphi code.
I think it was some upgrade from remobjects 8.x to 9.y

I see that we can uncheck the primary key flag but if I do that won’t that affect our update statements?
We want to keep the possibility to open datasets with primary keys=NULL but still be able to modify some of the records for which primary key is of course not NULL

Hi,

Primary Key cannot be NULL by its very definition so Data Abstract code is based on this assumption. Possibility to unset the Required attribute from a Primary Key did lead to undefined behavior so it has been removed.
A workaround for this if you still need to emulate this behavior is set InPrimaryKey & Required properties to False on client-side for specific field.

if it won’t work by some reasons, you can do it also in SchemaModeller:

  • create delta commands
  • make sure that they are assigned to specific table
  • remove InPrimaryKey & Required attributes for fields of this table
  • [client-side] update table schema