Martin Schreiber  wrote / napĂ­sal(a):
On Friday 25 April 2014 07:46:23 LacaK wrote:
Do you have tried for ftAutoInc field simply set ReadOnly:=False; ?
-Laco.
P.S. there is feature request about automatic fetching of new values of
idnetity columns, but implementing it in generic way for all supported
SQLConnections is not trivial ;-)

In MSEgui I used flags in tfield.providerflags1 (pf1_refreshinsert,pf1_refreshupdate) which trigger the use of the "returning" clause in insert or update statement if the DB supports it. Additionally there is tcustomsqlconnection.updateprimarykeyfield() which is called after insert, it automatically updates the primary key field field with the "last insert id" if the DB supports it. The third option is to use tsequencelink which automatically fetches sequence values from the DB before inserting.
Thanks for interesting points, ideas
-Laco.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to