Page 1 of 1

SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Posted: Mon 30 Dec 2013 20:12
by AndreMurta
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?

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Posted: Tue 31 Dec 2013 07:53
by AlexP
Hello,

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

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Posted: Mon 13 Jan 2014 13:49
by andy_bri
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?

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Posted: Mon 13 Jan 2014 15:50
by AlexP
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;

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Posted: Sat 08 Feb 2014 18:38
by andy_bri
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.

Re: SQL Generator UniDAC 5.2.5 and Lazarus 1.0.14

Posted: Mon 10 Feb 2014 11:20
by AlexP
The product sources are distributed only with UniDAC Professional Edition with source code. We plan to release UniDAC including this fix next week.