sql log file with sql statement and parameter value lazarus / 21-General ---------------------------------------------------------------------- Packs · 2024-11-30 10:43 I have lot of query with parameters . can I log inside file with sql statement and it's parameter value . how to achieve this. ---------------------------------------------------------------------- CharlyTango · 2024-11-30 20:01 Yes, you can ;-) Unfortunately, my crystal ball is currently being serviced and is therefore out of order. For a qualified answer, it would be nice if you could also specify which Lazarus version, which FPC version you are using and which access path you have chosen (SQLDB, ZEOS, other) and perhaps also against which SQL database you are querying. All this could have an influence on the answer. Some SQL databases have a monitor option to see incoming and outgoing SQL statements. For SQLDB, TSQLConnector.OnLog is your friend and for ZEOS, TZSQLMonitor might be helpful. For other access paths ask the vendor ;-) ---------------------------------------------------------------------- Zvoni · 2024-12-02 08:06 Quote from: CharlyTango on November 30, 2024, 09:01:22 pmYes, you can ;-)Quoting Obama?  QuoteUnfortunately, my crystal ball is currently being serviced and is therefore out of order.I broke my ball last week.... QuoteSome SQL databases have a monitor option to see incoming and outgoing SQL statements. SQLite has "expanded SQL" function, which does exactly that (returning the "parsed" SQL-Statement with the parameterized Values), which i even managed to get to work (with a Class-Helper) EDIT: Have to amend my "got to work": It involved some "edit" inside sqlite3conn, since we need the Cursor (=TSqlite3Cursor), and this type is under the implementation-section (for whatever reason), so it won't work with Class helper and/or derived class Anyone know why it's under implementation in sqlite3conn, when its ancestor (TSQLCursor) is under Interface in sqldb?