Query with no result lazarus / 16-Databases ---------------------------------------------------------------------- Miflon · 2023-08-26 12:26 Hi every one. W10 win64; Lazarus 2.2.2; fpc 3.2.2; postgresql What is the postgresql error code when a query returns no result? Thanks for your replies. ---------------------------------------------------------------------- Чебурашка · 2023-08-26 13:03 There is no error as it is normal that certain queries have 0 records of result. Simply you have to check query.EOF before accessing the fields of the result. ---------------------------------------------------------------------- TRon · 2023-08-26 14:59 As stated by Чебурашка, there is no error code returned because a query returning zero results is perfectly valid so use the suggested method or alternatively you could use IsEmpty ---------------------------------------------------------------------- Miflon · 2023-08-27 08:46 Thanks to you both. I think I'l do a try to IsEmpty.