Page 1 of 1

Error: PostgreSql Master-Detail in Delphi XE3

Posted: Wed 14 Aug 2013 16:09
by flls
5.0.1 25-Apr-13

Rad Studio XE4 is supported
NEXTGEN compiler is supported
Application development for iOS is supported
Connection string support is added
Possibility to encrypt entire tables and datasets is added
Possibility to determine if data in a field is encrypted is added
Support of TimeStamp, Single and Extended fields in VirtualTable is added
Migration from PgDAC and LiteDAC is added to the Migration Wizard
Migration from AnyDAC and FireDAC is added to the Migration Wizard
Bug with Master-Detail for TClientDataSet in Rad Studio XE3 is fixed
Bug with Master-Detail by non-English fields is fixed
Bug with IndexFieldNames by non-English fields is fixed
...
The error continues to PostgreSql, even in version 5.0.2. With Oracle works correctly, but in PostgreSql only works in design time, at runtime does not work. :|

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Mon 19 Aug 2013 11:29
by AlexP
Hello,

Most probably, you have old *.bpl, *.dcu, *.pas, etc., files remained. Please delete all the old files and try reinstalling UniDAC once more.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Wed 18 Sep 2013 18:46
by flls
Finally found the bug, with the help of DbMonitor. I noticed that in all the queries parameter values ​​were passed correctly, BUT the parameter name appeared in quotation marks. I did a test putting SQLText parameters in quotation marks and the master detail returned to work. Then:

SELECT * FROM TableB WHERE field1 =: key -> Does not work

SELECT * FROM TableB WHERE field1 =: "key" -> works normally

The strangest detail of all this: In Oracle, the master-detail relationships created in earlier versions of UniDAC work, any new TUniQuery I put in the form the master-detail no longer works. In PostgreSQL, master-detail relationships do not work, both those created in previous versions and for the new ones.

What can be causing this problem? I have no other versions of the product installed, I always completely uninstall the previous version before installing the new.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Wed 18 Sep 2013 19:48
by flls
I found the reason for the problem to occur. In the previous UniDAC I used as database development Oracle, then my TUniConnection in datamodule pointed to a Oracle connection.

Since March/2013 we started using PostgreSQL as database development, and Oracle as database production, then my TUniConnection in datamodule currently points to a connection PostgreSQL.

When I put a new component TUniQuery in the form (connected to PostgreSQL), when I add the fields to the component (Ctrl + F) the name of them comes in lowercase.

When I open a query detail, as the master query fields are in lowercase, the UniDAC is involving the name of the input parameters in quotation marks.

I did the test: With the Object Inspector I converted all field names of the queries to uppercase and the detail queries now operating normally.

Something has changed in version 5.0.2, the parameters of the queries started getting case sensitive.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Fri 20 Sep 2013 13:04
by DemetrionQ
Hello.
SELECT * FROM TableB WHERE field1 =: key -> Does not work
Please specify what you mean by "Does not work".

Try to set the TPgQuery.Options.QuoteNames option to False and check if the problem repeats.

Note: by default, PostgreSQL server creates fields with names in lowercase.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Sat 21 Sep 2013 22:59
by flls
TPgQuery.Options.QuoteNames = FALSE

Like I mentioned in the first post, in DESIGNTIME when I move the master dataset, datasets detail are also updated. In RUNTIME when I move the master dataset, datasets details are not updated, they remain in the same record.

With the Oracle database I can make it work IF I create all DataFields of Dataset with the names in uppercase.

With the PostgreSQL database the detail datasets are NEVER updated when I move the master dataset.

It's that simple, and it only began to occur after upgrading to version 5.0.2, I'm thinking of going back to the old version, since I can not find a solution to this problem.
:cry:

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Sun 22 Sep 2013 00:19
by flls
PS: The the old version is 4.6.12 (works normally)

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Tue 24 Sep 2013 06:26
by AlexP
Hello,

We cannot reproduce the problem. Please send a small application demonstrating the problem, as well as the script for creating and filling in the DB objects to alexp*devart*com .

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Wed 25 Sep 2013 16:43
by flls
Email sent today. Thank you.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Mon 07 Oct 2013 23:11
by flls
AlexP,

can you confirm that you have received the mail on 09/25/2013?

Thank you.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Wed 09 Oct 2013 09:14
by AlexP
Hello,

We have received your sample and reproduced the problem. We will inform you as soon as fix thу problem.

Re: Error: PostgreSql Master-Detail in Delphi XE3

Posted: Thu 10 Oct 2013 15:08
by flls
:D Thank you.