Error: PostgreSql Master-Detail in Delphi XE3

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Wed 14 Aug 2013 16:09

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. :|

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

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by AlexP » Mon 19 Aug 2013 11:29

Hello,

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

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Wed 18 Sep 2013 18:46

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.

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Wed 18 Sep 2013 19:48

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.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by DemetrionQ » Fri 20 Sep 2013 13:04

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.

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Sat 21 Sep 2013 22:59

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:

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Sun 22 Sep 2013 00:19

PS: The the old version is 4.6.12 (works normally)

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

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by AlexP » Tue 24 Sep 2013 06:26

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 .

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Wed 25 Sep 2013 16:43

Email sent today. Thank you.

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Mon 07 Oct 2013 23:11

AlexP,

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

Thank you.

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

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by AlexP » Wed 09 Oct 2013 09:14

Hello,

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

flls
Posts: 20
Joined: Fri 13 Apr 2007 17:05

Re: Error: PostgreSql Master-Detail in Delphi XE3

Post by flls » Thu 10 Oct 2013 15:08

:D Thank you.

Post Reply