Change SQL programmatically

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ErezHarari
Posts: 5
Joined: Wed 21 Jul 2010 14:50

Change SQL programmatically

Post by ErezHarari » Thu 14 Mar 2013 08:21

When I change programmatically the SQL statement of TSmartQuery or TOraQuery instance I received incorrect result (that is the query returns records that contains wrong data for example date field may have same date for all rows instead of various dates).

Code example:
Query.Close;
Query.Sql.Text := 'Select x,y,z From ...;
Query.Open;

Environment:
Delphi XE
ODAC 8.6.12
Oracle 10g

Comments:
1. The query created in design time and has fields that match the new statement.
2. This issue does not exists in Delphi 2007 with older ODAC components.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Change SQL programmatically

Post by AlexP » Thu 14 Mar 2013 11:07

Hello,

We cannot reproduce the problem. When changing the SQL query in runtime, data from the new query is displayed correctly. Please send the scipts for creating and filling both tables, and specify the ODAC version.

Post Reply