на входе в aSelectSql запрос простой: select id, name from table1
Код: Выделить всё
procedure GenSQL(UniQuery: TUniQuery; const aSelectSql: string);
begin
UniQuery.SQL.Text := aSelectSql;
UniQuery.KeyFields := 'id';
UniQuery.Open;
UniQuery.SQLInsert.Text := TDBAccessUtils.SQLGenerator(UniQuery).GenerateSQL(TDAParamsInfo.Create(TDAParamInfo) , _stInsert, true);
OutputDebugString(Pwidechar(UniQuery.SQLInsert.Text));
UniQuery.SQLUpdate.Text := TDBAccessUtils.SQLGenerator(UniQuery).GenerateSQL(TDAParamsInfo.Create(TDAParamInfo) , _stUpdate, true);
OutputDebugString(Pwidechar(UniQuery.SQLUpdate.Text));
UniQuery.SQLDelete.Text := TDBAccessUtils.SQLGenerator(UniQuery).GenerateSQL(TDAParamsInfo.Create(TDAParamInfo) , _stDelete, true);
OutputDebugString(Pwidechar(UniQuery.SQLDelete.Text));
UniQuery.SQLRefresh.Text := TDBAccessUtils.SQLGenerator(UniQuery).GenerateSQL(TDAParamsInfo.Create(TDAParamInfo) , _stRefresh, true);
OutputDebugString(Pwidechar(UniQuery.SQLRefresh.Text));
//UniQuery.close;
end;
UniDAC 8.0.1, Delphi Rio.