How(and where) can I see and modify, in the runtime auto generated INSERT / UPDATE / DELETE statments?
Ignore, change, expand, add support for other tables?
Michal
Modify auto-generated SQL statements
Re: Modify auto-generated SQL statements
If the TUniQuery.SQLInsert.Text / TUniQuery.SQLUpdate.Text / TUniQuery.SQLDelete.Text property is empty, UniDAC automatically generates and executes INSERT/UPDATE/DELETE query only for the main table.
You can see the SQL query (but not modify) which UniDAC will execute when changing data using the BeforeUpdateExecute event handler. For example:
You can create custom SQL queries to change data and then in run-time or design-time set them to the TUniQuery.SQLInsert.Text / TUniQuery.SQLUpdate.Text / TUniQuery.SQLDelete.Text property.
More details about dataset properties SQLInsert/SQLUpdate/SQLDelete in our online documentation: https://www.devart.com/unidac/docs/?dev ... embers.htm
You can see the SQL query (but not modify) which UniDAC will execute when changing data using the BeforeUpdateExecute event handler. For example:
Code: Select all
procedure TForm1.UniQuery1BeforeUpdateExecute(Sender: TDataSet;
StatementTypes: TStatementTypes; Params: TDAParams);
var
SQLText: string;
UpdateQuery: TComponent;
begin
if stInsert in StatementTypes then begin
UpdateQuery := TDBAccessUtils.GetUpdateQuery(TCustomDADataset(Sender));
SQLText := TDBAccessUtils.GetSQL(UpdateQuery).Text;
...
end;
More details about dataset properties SQLInsert/SQLUpdate/SQLDelete in our online documentation: https://www.devart.com/unidac/docs/?dev ... embers.htm