Beginner Question: Detecting empty query result lazarus / 16-Databases ---------------------------------------------------------------------- dietmar · 2021-10-05 12:12 Hi, I gather data from a table via Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   DBHelper.SelectQuery('SELECT * FROM Owner LIMIT 1;');  with DBHelper.SQLQuery do begin    edAuthor.Text := FieldByName('Wiz_Name').AsString + ' (' +      FieldByName('RL_Name').AsString + ')';  How can I detect whether the query returns an empty result set? Thx, --Dietmar ---------------------------------------------------------------------- ccrause · 2021-10-05 12:32 Check if IsEmpty of the resulting dataset returns true. ---------------------------------------------------------------------- af0815 · 2021-10-06 04:30 Another way is, to check with "Q.BOF AND Q.EOF". If a query is on Begin and End at the same time, the query is empty. This is the same as IsEmpty. ---------------------------------------------------------------------- dietmar · 2021-10-06 17:01 Ok, and say I am using an UPDATE statement on the table. If I do this manually, I usually get only a "ok, 1 row affected" or whatever back. How can I determine here whether the update was successful? Thx, --Dietmar ---------------------------------------------------------------------- Zvoni · 2021-10-07 07:33 Huh? TSQLQuery inherits from TCustomSQLQuery, and TCustomSQLQuery has a public Function RowsAffected https://www.freepascal.org/docs- html/fcl/sqldb/tcustomsqlquery.rowsaffected.html