Unit 'msqldb' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#msegui]

tsqlstatement

[Properties (by Name)] [Methods (by Name)]

Executes an SQL statement which returns no rows (INSERT, UPDATE, DELETE, DDL...), without the overhead of a dataset

Declaration

Source position: msqldb.pas line 663

type tsqlstatement = class(tcursorsqlstatement)

published

  property params: tmseparams;

  property sql: tsqlstringlist;

  property database: tcustomsqlconnection;

  property transaction: TSQLTransaction;

  property options: sqlstatementoptionsty;

  property statementtype: TStatementType;

  property onbeforeexecute: sqlstatementeventty;

  property onafterexecute: sqlstatementeventty;

  property onerror: sqlstatementerroreventty;

end;

Inheritance

tsqlstatement

  

Executes an SQL statement which returns no rows (INSERT, UPDATE, DELETE, DDL...), without the overhead of a dataset

|

tcursorsqlstatement

|

tcustomsqlstatement

|

tmsecomponent,itransactionclient,idatabaseclient

  

Extends the FPC tcomponent with object linking facilities and the like; base of every MSEgui component

|

tcomponent,ievent,iificommand,iificlient

|

tpersistent

|

TObject

Description

Executes an SQL statement which returns no rows (INSERT, UPDATE, DELETE, DDL...), without the overhead of a dataset. The statement is prepared on the first execute and stays prepared until sql changes, so executing it repeatedly with different params is much faster than executedirect: Martin measured 1.1 s instead of 5.2 s for 10,000 inserts into Firebird 2.0. execute(aparams) assigns the values to params in order before executing; rowsaffected returns the number of rows modified (-1 if the backend does not support it).

The transaction is not committed unless sso_autocommit (or sso_autocommitret for commitretaining) is set in options. A dataset showing the modified table does not see the changes until it is refreshed (tdataset.refresh).


Documentation generated on: 2026-10-03