Hello,
i am using unidac 6.3.13. I have Sql server 2012 where is use for id values sequence.
The table is generated like this:
ALTER TABLE [dbo].[l_matriksi] ADD CONSTRAINT [DF_L_MATRIKSI_id_matriksa] DEFAULT (NEXT VALUE FOR [id_matriksa_seq]) FOR [id_matriksa].
Table is l_matriksi, key field is id_matriksa, and sequence is id_matriksa_seq.
When i use insert and post i cant get back key field value?
uniquery1.insert;
uniquery.Post;
uniquery.fieldbyname('id_matriksa').AsInteger <- this is empty
Records are inserted ok.
Is there any settings i should use? In order that this insert works i only set RequiredFields := false;
SQL server with sequence's
Re: SQL server with sequence's
To obtain the key field value generated on the server when inserting a record, set the
TUniQuery.Options.DefaultValues property value to True. More information about DefaultValues in our online documentation: https://www.devart.com/unidac/docs/?dev ... values.htm
TUniQuery.Options.DefaultValues property value to True. More information about DefaultValues in our online documentation: https://www.devart.com/unidac/docs/?dev ... values.htm
Re: SQL server with sequence's
Thank you for the answer. It works.