Inform Tfdautoincfield field value using Fdquery

Asked

Viewed 330 times

4

Hello, Utiliso Mysql and I am migrating my projects from Delphi 2007 + Zeos to Delphi Berlin + Firedac (big change eim) and due to some business rules, auto increment fields of Mysql can be informed by the user. ex: The Idproduto field is a bigint(20) not null autoinc, but due to government rules this field can be filled manually by the customer, in Zeos this was not a problem, I just informed the value and ready.

In Firedac autoinc fields are not included in Insert SQL in Fdupdatesql. To manually enter the value the field I have to change the properties Serverautoincrement and Clientautoincrement to False and manually include the field in Insert SQL, but whenever I need to create a new field in the table I will have to worry about including the field in Insert SQL, besides being subject to failures this approach has all the face of a POG.

I would like to know the correct configuration (Fdquery, field and Fdupdatesql) to have an Autoinc field and still be able to inform you manually when necessary.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.