SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AndreMurta
Posts: 5
Joined: Tue 05 Feb 2013 09:26

SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Post by AndreMurta » Mon 30 Dec 2013 20:12

Hi guys,

I'm facing a strange behavior using UniDAC 5.2.5 on Lazarus 1.0.14 (64 bits).
I'm connecting to a remote MySql database, the connection between the 'TUniConnection' component and the remote database is being stablished, I dropped a 'TUniQuery' component in my form and through the UniQuery Editor option, I'm defining the following statement as the SQL query:

Code: Select all

select * from clientes
The fields list is being retrieved from the table in the "SQL Generator" sheet, but when I try to generate the queries for the selected table, I have always a "?" where I should have the field parameters. For example, the insert query is being produced like:

Code: Select all

INSERT INTO CLIENTES
  (CGC, DIV, RAZAO, CIDADE, ...)
VALUES
  (?, ?, ?, ?, ...)
Before version 5.2.5 I was using UniDAC 4.6.12 and this option used to work just as I expected. The insert query in the 4.6.12 version is produced like:

Code: Select all

INSERT INTO CLIENTES
  (CGC, DIV, RAZAO, CIDADE, ...)
VALUES
  (:cgc, :div, :razao, :cidade, ...)
Is this a "bug" or there is any detail I'm not paying attention?

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

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Post by AlexP » Tue 31 Dec 2013 07:53

Hello,

We have already fixed the problem, the fix will be included to the next version of UniDAC

andy_bri
Posts: 19
Joined: Fri 02 Oct 2009 12:36

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Post by andy_bri » Mon 13 Jan 2014 13:49

I have got the same problem with Firebird/Delphi XE4.
I was waiting for many days, but on your server there are still invalid libraries.
When the new version will be available?
Maybe you could just update version 5.2.5 and share it to download?

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

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Post by AlexP » Mon 13 Jan 2014 15:50

Hello,

To solve the problem, you should modify the TDASQLGeneratorFrame.GenerateSQLforUpdTable method in the DASQLGeneratorFrame.pas module as follows:

Code: Select all

function TDASQLGeneratorFrame.GenerateSQLforUpdTable(
  TableInfo: TCRTableInfo; const KeyAndDataFields: TKeyAndDataFields;
  const StatementType: TStatementType; const ModifiedFieldsOnly: boolean): string;
begin
  TDBAccessUtils.SQLGenerator(LocalDataSet).SubstituteParamName := False;
  Result := TDBAccessUtils.SQLGenerator(LocalDataSet).GenerateSQLforUpdTable(TableInfo, KeyAndDataFields, StatementType, ModifiedFieldsOnly);
end;

andy_bri
Posts: 19
Joined: Fri 02 Oct 2009 12:36

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Post by andy_bri » Sat 08 Feb 2014 18:38

Thank you, but there I could not find such a file in my installation. Folder C:\Program Files (x86)\Devart\UniDAC for RAD Studio XE4\Source contains just four .pas files.

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

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Post by AlexP » Mon 10 Feb 2014 11:20

The product sources are distributed only with UniDAC Professional Edition with source code. We plan to release UniDAC including this fix next week.

Post Reply