UniDAC/PostgreSQL/MasterDetail problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jbakuwel
Posts: 35
Joined: Tue 02 Feb 2010 04:47

UniDAC/PostgreSQL/MasterDetail problem

Post by jbakuwel » Fri 12 Nov 2010 05:21

Hi,

UniDAC 3.00.0.10 / PostgreSQL 8.3 / Delphi 2010

I have two tables in a master detail relationship. I add one record to the master table, post this, verifies it gets inserted in the database. The I add a detail record, post this, verifies it gets inserted in the database. So far so good.

However, the detail record doesn't display on the screen. When enabling debugging on the detail DataSet and browsing through the master DataSet, I can see the detail records are correctly retrieved for any of the already existing (ie prior to adding new as described above), but not for the new detail record just added to the database. In this case the query "SELECT * FROM detai> WHERE detail.pk IS NULL" is generated (ie. "IS NULL" instead of the corresponding primary key of the master record).

Closing and opening the detail dataset makes no difference, however closing and opening the master dataset "fixes" the problem.

It look very much like the bug reported here:

http://www.devart.com/forums/viewtopic. ... elect+null

however I cannot find the property RefreshParamsOnInsert.

Please advise.

kind regards,
Jan

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

Post by AlexP » Fri 12 Nov 2010 08:55

Hello,

The RefreshParamsOnInsert variable is declared in the DBAccess unit. Check that the DBAccess unit was added to the uses section and set RefreshParamsOnInsert to true.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Mon 15 Nov 2010 09:15

Please add this property in the TXXXConnection options as this is not the default TDataset behaviour...

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

Post by AlexP » Mon 15 Nov 2010 09:42

Hello,

We will investigate the possibility of adding this feature in one of the next builds/versions of DAC.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Mon 15 Nov 2010 10:10

thank you in advance Alex.

Post Reply