Modify SQL text on the fly
Posted: Fri 15 Feb 2019 15:36
Hi,
i have a lot of old delphi codes like this:
SomeQuery.SQL.Text:='select Name from SomeTable where Version=:Version ';
SomeQuery.ParamByName('Version').asString:='1';
SomeQuery.Open;
now application adopted for work with PostreSQL via Unidac and code should like this:
'select "Name" from SomeTable where "Version"=:"Version" ';
So, please, help me to choose appropriate TUniQuery methods (to override) for change query text on the fly
There are a variety of places: BeforeOpen, AssembleSQL, InternalOpen, Macros....TUniQuery.SQL or TUniQuery.FCommand.SQL..etc
And how to synchronize parameters (or query params parsing) for updated quoted identifiers?
i have a lot of old delphi codes like this:
SomeQuery.SQL.Text:='select Name from SomeTable where Version=:Version ';
SomeQuery.ParamByName('Version').asString:='1';
SomeQuery.Open;
now application adopted for work with PostreSQL via Unidac and code should like this:
'select "Name" from SomeTable where "Version"=:"Version" ';
So, please, help me to choose appropriate TUniQuery methods (to override) for change query text on the fly
There are a variety of places: BeforeOpen, AssembleSQL, InternalOpen, Macros....TUniQuery.SQL or TUniQuery.FCommand.SQL..etc
And how to synchronize parameters (or query params parsing) for updated quoted identifiers?