Hello,
I would like to add TUniQuery component to form in RunTime, fill SQL (Select statement) and base on that statement create Insert, Update, Delete statements.
Is this scenario possible in RunTime and does TUniQuery component has method for create/recreate SQL's in runtime?
Thanks in advance...
Recreate SQL's in RunTime
Re: Recreate SQL's in RunTime
Hello,
Below is a code of retrieving the UPDATE SQL query.
Below is a code of retrieving the UPDATE SQL query.
Code: Select all
uses ..., CRAccess, DASQLGenerator;
...
var
pi: TDAParamsInfo;
UniQuery: TUniQuery;
begin
UniQuery := TUniQuery.Create(nil);
try
UniQuery.Connection := UniConnection1;
UniQuery.SQl.Text := 'Select * from dept';
UniQuery.Open;
pi := TDAParamsInfo.Create(TDAParamInfo);
try
ShowMessage(TDBAccessUtils.SQLGenerator(UniQuery).GenerateSQL(pi, _stUpdate, False));
finally
pi.Free;
end;
finally
UniQuery.Free;
end;
end;