[SOLVED] Discover a Generated Field in AfterPost event lazarus / 16-Databases ---------------------------------------------------------------------- DeBritto · 2016-08-04 01:58 Hi Folks, I need to discover the value of a field, that is a result of a Firebird Generator, in After Post Event of a TSqlQuery Component in a multiuser environment. Is it possible? This issue is driving me crazy, because I need this number to trigger an insert/update/delete in another table. Best regards, Christian ---------------------------------------------------------------------- sky_khan · 2016-08-04 03:25 You may manually retrieve a new generator value by another query Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  SELECT GEN_ID( , 1 ) FROM RDB$DATABASE; and you would know generator value beforehand and you can use it in BeforePost event to set any id field you need. If any errors occurs at posting that particular value will be wasted but IMO, it is not a problem if you are not dealing with enormous count of records. ---------------------------------------------------------------------- goodname · 2016-08-04 12:04 The Firebird FAQ answers this question. http://www.firebirdfaq.org/faq243/ ---------------------------------------------------------------------- LacaK · 2016-08-04 18:42 FPC 3.0 has introduced new property named Sequence in TSQLQuery. It is able to fetch generated values back to your dataset, so you do not need do special processing. ---------------------------------------------------------------------- DeBritto · 2016-08-05 22:10 Thank you so much guys, You SOLVED my problem! I have lost weeks trying to solve this. Best regards