Page 1 of 1

How to get the DEFAULT value of a column from metadata?

Posted: Thu 22 Apr 2010 08:33
by u.masotti
In my application, actually Firebird 2.1 and Fb 2.5 RC i8n test, I have some fields that are defined NOT NULL and on a "DEFAULT 0" user defined domain.

I'm using query and update objects,through a TCustomClientdataset derived component.
When I add record to a query, at POST the fields are defined as Required because of the "NOT NULL" definition but I'm not able to get that they are also DEFAULTed so to keep appropriate action in i.e. BeforePost event.
In BDE a required field is defined as NOT NULL and NOT DEFAULTed (AFAIU my Delphi 7 vcl sources) and that seems right, because post don't need to check for a field NOT NULL that has a default when there are update objects to keep track of server errors in ApplyUpdates.
Perhaps the model under ClientDataSet doesn't support that?
Anyway I need to know how recognize when a field has a default defined (and eventually) get that value to assign to the params in the insert query of the update object.
Are there any solution or hint?
Many thanks in advance.

Mimmo.

Posted: Thu 22 Apr 2010 11:59
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next DbxIda build.

Posted: Thu 22 Apr 2010 14:53
by u.masotti
Dimon wrote:Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next DbxIda build.
Mmmmh.. Ok. :)
Please note that I've already changed metadata queries to reflect my situation and rebuilt library (dbx*.dll).
Do you mean that in actual version of the driver it's impossible to pick that information?
And related to this, are there any chance to download and test snapshot build?
Thanks.

Posted: Fri 23 Apr 2010 06:29
by Dimon
Please contact us by dmitryg*devart*com email and specify your developer license number.