[sqlite] simple query - error lazarus / 16-Databases ---------------------------------------------------------------------- wht244 · 2010-10-27 05:26 i have a problem with a simple query: Code: [Select]SELECT nazwisko FROM handlowcy WHERE id = 1 LIMIT 0, 1in sqlite database browser this query returns what i want, but if i try to execute that query with lazarus: Code: [Select]query.SQL.Text := 'SELECT nazwisko FROM handlowcy WHERE id = 1 LIMIT 0, 1'; try   query.Open; finally   query.Close; end;i get an error: Code: [Select]near: LIMIT syntax erroror something like this. any suggestions how to deal with it? i'm using components from SQLdb tab (built-in) ---------------------------------------------------------------------- gastonx · 2010-10-27 08:32 Which database? MSSQL or mySQL? MSSQL has no LIMIT function. Only TOP. ---------------------------------------------------------------------- Lacak2 · 2010-10-27 08:58 Which version of FPC ? There was patch 5 months ago, which adds handling of LIMIT keyword into SQLParser see http://bugs.freepascal.org/view.php?id=15456 ---------------------------------------------------------------------- wht244 · 2010-10-27 12:43 how to install this patch? ---------------------------------------------------------------------- xenblaise · 2010-10-27 17:00 try that; query.SQL.Text := 'SELECT nazwisko FROM handlowcy WHERE id = 1 LIMIT 1'; ---------------------------------------------------------------------- Lacak2 · 2010-10-28 03:07 Quote from: wht244 on October 27, 2010, 02:43:45 pmhow to install this patch? You can download daily snapshot of Lazarus with FPC 2.5.1 from ftp://www.hu.freepascal.org/pub/lazarus/snapshots/ ---------------------------------------------------------------------- wht244 · 2010-10-28 03:41 i set field ParseSQL of TSQLQuery to false and that helped me a lot. but i encountered other problem. query: Code: [Select]UPDATE handlowcy SET nazwisko = 'test' WHERE id = 1 LIMIT 1is also interpreted as it has error with syntax near LIMIT. ---------------------------------------------------------------------- Lacak2 · 2010-10-28 04:54 Do you use Filter or ServerFilter properties of SQLQuery component ? Is SQLQuery in master-detail relationship with another component ? ---------------------------------------------------------------------- wht244 · 2010-10-28 11:45 Filter and ServerFilter are not used. Only relationships are TSQLTransaction and TSQLite3Connection. ---------------------------------------------------------------------- xenblaise · 2010-10-28 15:58 QuoteUPDATE handlowcy SET nazwisko = 'test' WHERE id = 1 LIMIT 1 just no limit while id = 1 UPDATE handlowcy SET nazwisko = 'test' WHERE id = 1 QuoteFilter and ServerFilter are not used. Only relationships are TSQLTransaction and TSQLite3Connection. yes